Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I rename a file with a space in it?
Message
From
30/10/2001 13:52:18
Charles Richard
Nvo Management Systems
Boisbriand, Quebec, Canada
 
 
To
30/10/2001 13:24:11
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00574713
Message ID:
00575235
Views:
26
Check the file created by your code. It doesn't have the two spaces in front of the name. Also I check the leading character in my file and you are right. It is a chr(32).

>>Fcreate create a file without the leading space.
>>Fopen and Fwrite don't treat file names, just content.
>>Erase &cFileName is like Erase (2 spaces) filename and is treated like 1 space
>>FileToStr reads the file properly
>>
>>Still no way to delete or rename the file
>
>
cFile="  file with two spaces in front.txt"
>CLEAR
>=STRTOFILE("just testing", cFile)
>?"created, exists?",FILE(cfile)
>ERASE (cFile)
>?"erased (cFile), still exists?",FILE(cfile)
>=STRTOFILE("just testing", cFile)
>?"created, exists?",FILE(cfile)
>ERASE "&cFile"
>?"erased '&cFile', still exists?",FILE(cfile)
>Here it just does it right - I'm getting
>
>created, exists? .T.
>erased (cFile), still exists? .F.
>created, exists? .T.
>erased '  file with two spaces in front.txt', still exists? .F.
>Tested in VFP7 on W2000 SP1 WS.
>Are you sure those two leading characters are actually spaces and not some weird characters?
Charles Richard
NVO Management Systems
crichard@nvo.ca
Previous
Reply
Map
View

Click here to load this message in the networking platform