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

>>Originally, I set the current directory to the location of the file. I just tried from a parent directory and funny thing ...:
>>
>>I put the path in a variable then tried the other functions:
>>
>>ADIR still works, RENAME and ERASE still fail but FOPEN works.
>>
>>Go figure ...
>>
>>But this is an exotic curcumstance ... there should not be a space as the first character of a file ... Maybe that was the case in the one you remember ...
>
>Adir() and fopen() read it, but those which have something to do to the file probably don't. Does FileToStr() work? If it does, you can still copy the file, and then open it with fopen() and than truncate it somehow? Would fCreate() work? You may end with a bunch of zero-length files, though, but erasing them manually once a month wouldn't be too hard.
>
>The other exotic situation was about some strange device name, don't remember exactly what, but it should have behaved like a disk, but didn't. I remember that macro substitution, with macro within quotes, did work in that case. You may try that as well, i.e. erase "&cFileName".
Charles Richard
NVO Management Systems
crichard@nvo.ca
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform