Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I delete a file with a leading space?
Message
De
23/08/1999 17:49:08
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00255531
Message ID:
00256826
Vues:
45
>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.

Putting the file name in quotes does not work if it's a leading space. If it's an imbedded space, quotes work just fine. Anyways, it wasn't my problem, I was just trying to help!
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform