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
29/10/2001 23:42:47
Charles Richard
Nvo Management Systems
Boisbriand, Quebec, Canada
 
 
To
29/10/2001 23:15:38
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00574713
Message ID:
00574872
Views:
33
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 ...


>>Nope. ADIR puts the file name into an array but RENAME, ERASE, FILE and FOPEN fail even using the parenthesised variable method.
>>
>>>
  • VFP has three ways to delimit texts: double quotation marks, single quotation marks, and []. Thus, if a text contains single quotation marks, you can use double quotation marks on the outside, or vice-versa.
    >>>
  • I think if you use a variable for both the source name and the destination name, the following should work even if the filename contained spaces or quotation marks:
    >>>
    >>>
    >>>rename (source) to (target)
    >>>
    >
    >But then aDir() doesn't include the path - but I presume you added it, i.e. that source and target variables contain regular paths. This is the first time I've heard of a named expression not being able to find the file. There actually was one before, but it happened in some exotic circumstances to someone here, and I can't remember what it was.
    Charles Richard
    NVO Management Systems
    crichard@nvo.ca
  • Previous
    Next
    Reply
    Map
    View

    Click here to load this message in the networking platform