Valid Filenames? 
Author Message
 Valid Filenames?

Hey all. There must be an easier way to check a users input to see if it's a
valid filename than what I've been doing. I'm using VB6 Pro. is there any
way other than looking for the existance of every invalid char?

Tommy



Wed, 27 Mar 2002 03:00:00 GMT  
 Valid Filenames?
Dear Tommy,

I don't know of an API that checks, but you could just go ahead and attempt to
write the file (OPEN "test.fil" FOR OUTPUT as #1) inside an error handling
routine.  If the file opens without error, it's a valid filename.  Otherwise,
issue your warning.  Then just KILL the test file you opened.  

If the file already exists, then just open it for input first and then close
it.  If found, then all is well.

Cheers
Steve Pugliese



Wed, 27 Mar 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. valid filenames for shell functions?

2. Checking for valid filename

3. check string as valid filename

4. API to test for valid filename?

5. Valid FileName

6. DOS wildcard, *, not valid with .FileName?

7. Detecting if a filename is a valid picture file

8. Converting an invalid filename to a valid one

9. getting just the filename, not the filename path from the opendialog control

10. SHORT filename to LONG filename???

11. ? How extract filename, dir, filename, extension ?

12. Short Filename to Long Filename ???

 

 
Powered by phpBB® Forum Software