Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Validating a path/filename
Message
De
24/12/2012 09:56:58
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Validating a path/filename
Divers
Thread ID:
01560549
Message ID:
01560549
Vues:
83
Hi,

I would like to have a function to validate filenames.

I took a look at thread "Valid filename" (http://www.levelextreme.com/DataEntryThreadView.aspx?ID=1502980), also checked http://www.berezniker.com/content/pages/visual-foxpro/determine-invalid-characters-file-name-and-path, but in there the main concern was about invalid characters, not validating the "syntax" of the path/filename.

To better explain what I mean, below are some examples (for for the sake of clarification I'll put them between "[]").

For instance, [CC//myfile.txt] would pass that validation, but it's not a valid filename.

How can I check if this contruct is valid? [\\servername\dir\subdir\filename], what about if it was written [\servername\dir\subdir\filename] ?

[Y:\My Folder\This is a file name with many spaces.txt]

And filenames with more than one ".": [C:\my file.for.test.txt]

If Windows can check, can we be able too do it? If yes, how?

TIA
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform