Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
File() isn't working with some files
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00251581
Message ID:
00251724
Views:
8
>>I have a program that locates and moves linked Word documents that users drop all over the network. Unfortunately, FILE() returns .F. for a file with the name such as "John C. Smith Letter.DOC". Files with periods or some other previously disallowed characters aren't recognized.
>>
>>If anyone has a solution or workaround, I would greatly appreciate it.
>>
>>TIA
>
>Dan,
>
>I just tested in VFP6 SP3 and file() works fine as long as the file name is enclosed in quotes, for example;
>
>Given a file named "testing spaces.txt".
>
>?File("Testing spaces.txt") && .T.
>mfile = "Testing Spaces.txt"
>?File(mfile) && .T.
>?File(Testing spaces.txt) && Error missing )

Jim, I haven't tried under SP3, but under earlier versions of VFP, there were some strange and wonderful errors in file name processing, specific instances that i encountered involved LFNs on NetWare 3.x volumes with the OS2 and/or Mac NameSpace enabled. Multiple periods in a file name, or a mix of periods and spaces in a file extension had wierd results. George Tasker also documented some reproducible errors for FILE() and ADIR() that were addressed by using API calls; he has a file handling class that can be downloaded here on UT that gives exact details.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform