Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I delete a file with a leading space?
Message
 
À
20/08/1999 13:14:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00255531
Message ID:
00256801
Vues:
33
Fred,

Intresting thread. I don't know if you have solved your delima, but here is my two cents worth.

When dealing with special file names (this file is a nonstandard DOS file name) problem, enclose the file name in qoutes unless the space is not a space.

ERASE "c:\program files\microsoft visual studio\vfp98\vpf.exe"

IF FILE(["c:\program files\microsoft visual studio\vfp98\" + " Junk.dbf"])
The file name with spaces are converted into a "short" file name or standard DOS file, i.e., c:\progr~1\micros~1\....

If it is a special character trap the character using the ASC() function then create a string out of the results:

x = ASC(LEFT( < file name >,1))
y = "'" +x +'junk.dbf'
ERASE &y

Let us all know your solution.

Mark Holmes

P.S. There has been enought effort spent on this to hire a full time employee who's job description is to delete file that start with spaces.
Software engineers are trained to read and understand code; they are not trained in mind reading. Document the purpose not just the functionality.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform