Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set default to...
Message
From
23/07/2001 09:09:32
 
 
To
23/07/2001 08:51:22
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00528803
Message ID:
00533852
Views:
11
>>Create a share on a server with the share name containing a space, such as the legal share name "A Space". Assuming that your server is named MyServer, issue the following commands:
>>
>>CD "\\MyServer\A Space"
>>? SYS(5)
>>
>>Notice that there is now a space in SYS(5), and since you've referenced it by UNC, there's no colon, and it's more than two characters in length.
>>
>>Try it, you won't be a happy critter at all at all. If you designate the starting folder in the shortcut as a UNC, you'll get bit - the OS sees the UNC and relies on the UNC, not a transient drive mapping...
>
>That's clarified part of the issue of sys(5), & the possibility of spaces in the value returned, again thanks.
>
>The second part of the problem, as stated, was that the "set default to sys(5)" would not compile - now with the above would you expect a compile time or run-time error.

Neither. I expect:

cPathName = SYS(5)
CD &cPathName

would generate a runtime error if SYS(5) returned a UNC with an embedded space. I don't see a problem with any version of VFP I have here, which is 5.0a, 6.0SP5 and 7.0RC1, but it's possible that some version of the compiler had this error and I just never saw it. The behavior of CD SYS(5) would be unpredictable with a UNC, since the UNC is treated as a full path; try:

CD "\\MyServer\ShareName\SubFolder"
CD SYS(5)
CD
CD C:\Windows\SYSTEM
CD SYS(5)
CD

Notice that with a UNC, CD SYS(5) moves you to the root of the share, while with a drive letter, it moves you to the relative path of the drive. You now see why I don't use CD SYS(5)
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