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:24:11
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
30/10/2001 12:15:49
Charles Richard
Nvo Management Systems
Boisbriand, Quebec, Canada
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00574713
Message ID:
00575213
Views:
29
>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?

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform