Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Legal 9x/2K/XP file names

Status
Not open for further replies.

mikemck7

Technical User
Dec 17, 2003
38
I'm trying to create a function in VFP8 that tests the validity of user-specified Windows 9x/2K/XP file names prior to creating them. Apart from the disallowed characters, what do I need to test for.
 

Well, the other obvious thing is the length of the filename. This depends on the type of disk formatting (NTFS or whatever). To be sure not to exceed the maximum, it should be less than 254 characters.

But, rather than check the syntax, it might make more sense to go ahead and create the file, but to error-trap the commands that do so. That way, you'll also trap attempts to create names that clash with files that already exist.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top