Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I delete a file with a leading space?
Message
From
30/08/1999 12:21:07
 
 
To
27/08/1999 20:26:22
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00255531
Message ID:
00259216
Views:
19
>>I have a situation where there are some files created that have a leading space, eg. " JUNK.DBF". Is there a way to delete this file programmaticly using VFP5? Delete file, !del, and RENAME seem to have no affect. I am able to delete them with Explorer but I don't want the user to have to deal with it.
>>
>>Thanks!
>
>This has turned out to be quite a long thread!
>
>How about:
>
>DEL ?junk.dbf
>or
>DEL *junk.dbf
>
>at the command line. The question mark replaces one character. The asterisk replaces any number. Just be sure to do a:
>
>DIR ?junk.dbf
>or
>DIR *junk.dbf
>
>first to ensure the only files deleted is the one you want...

Therein lies the problem. There are 12 files with the first three characters being different and the other 5 being the same. Using a wildcard to delete the objectional file would take the other 12 good files with it. What seems to work best is something similar to this:

oFile = fCreate("C:\ junk.dbf")
fClose (ofile)

x1='!del c:\junk~1.txt'
&x1


contributed by Peter Cortiel of PC Software,Willington, Connecticut.
Jim Philippi

quando omni flunkus moritati
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform