Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I delete a file with a leading space?
Message
From
20/08/1999 13:14:07
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00255531
Message ID:
00255945
Views:
28
>>Are you certain that the leading character is a space? I can get the following to work:
>>
>>cVar = 'this is dummy text'
>>=STRTOFILE(cVar, ' JUNK.DBF')
>>ERASE (' JUNK.DBF')
>>
>>with no problem under VFP6 with SP3 installed, at least under NT. I haven't tried it under Win9x.
>
>When I run your code under Win95, VFP 6 SP3, the leading space is removed. I can create the file with a leading space using:
>
>oFile = fCreate("C:\ junk.dbf")
>fClose (ofile)
>
>No native VFP code will delete this file. However, I can delete it through Explorer. So maybe there is an API funcion that can be used in VFP to remove these files.

Hmm, maybe there is an API routine to remove it. An interesting note about the file: It seems to be created with a long file name, even though it's only 5 chars long for it's stem. Mine was created as "JUNK~1.TXT" and showed up in the long file name side of a DOS DIR command as " junk.txt". Is there something special about long file names and ERASE?
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform