Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADIR with long directory names with spaces 1

Status
Not open for further replies.

SSDESIGN

Programmer
May 11, 2003
71
US
I need to determine if OUTLOOK.EXE is available.

As a test in using adir, this works:
STORE "D:\Client\books.exe" TO e_E_path
&& no spaces, names <= 8 positions
nl_found = adir(p_tempdir,(e_E_path))

These do not work:
STORE "C:\Program Files\Microsoft
office\Office\OUTLOOK.EXE" TO e_E_path
nl_found = adir(p_tempdir,'&e_E_path')
nl_found = adir(p_tempdir,('&e_E_path'))
nl_found = adir(p_tempdir,&e_E_path)
nl_found = adir(p_tempdir,(e_E_path))
nl_found = adir(p_tempdir,(&e_E_path))

OR

STORE '"C:\Program Files\Microsoft
Office\Office\OUTLOOK.EXE"' TO e_E_path
nl_found = adir(p_tempdir,'&e_E_path')
nl_found = adir(p_tempdir,&e_E_path)
nl_found = adir(p_tempdir,('&e_E_path'))
nl_found = adir(p_tempdir,(&e_E_path))
nl_found = adir(p_tempdir,(e_E_path))

So, in testing FILE() with the same STOREs, these did not work:

If File('&e_E_path')
If File(&e_E_path)

Any suggestions on how to get adir and/or file() to work with spaces or names > 8 positions.

Thanks in advance
 
Which Fox do you use ?

Why don't try this:
"if file(e_E_path)" ?


Tomas
 
FoxPro was written in the days of 16-bit DOS file structures. You may have to use the OS-assigned 8 bit equivalents. You can find them by using the DOS DIR command with the /X parameter.

DIR C: /X

Any long or space-containing folders or files will have an shortened name equivalent. For example, it will likely return the 8 character equivalent for "Program Files" as "PROGRA~1". Do the same for any other long or space-containing folders or files.
 
Ops...
I'm running FoxPro DOS 2.6 on a WIN2K machine.

So far I've tried the following with each of the STORE commands:
FILE(e_E_path)
FILE(&e_E_path)
FILE('&e_E_path')
All failed if a space is used in one or more names.

Thanks for the feedback...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top