Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Validating a path/filename
Message
From
24/12/2012 09:56:58
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Validating a path/filename
Miscellaneous
Thread ID:
01560549
Message ID:
01560549
Views:
82
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
Next
Reply
Map
View

Click here to load this message in the networking platform