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?