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.