API to test for valid filename? 
Author Message
 API to test for valid filename?

Is there an API function to determine if a string would make a valid file
name?

Mike T.



Fri, 13 Dec 2002 03:00:00 GMT  
 API to test for valid filename?
Mike,

Quote:
>Is there an API function to determine if a string would make a valid file name?

How about trying to create it (or open it if it exists) using
CreateFile? If the string contains an invalid filename, CreateFile
will surely fail.

Mattias

____________________________________________

    http://hem.spray.se/mattias.sjogren/



Sat, 14 Dec 2002 03:00:00 GMT  
 API to test for valid filename?
No need for an API, since VB's built-in DIR{} function will do this for you.
Try this:

filename = "C:\CONFIG.SYS"
if DIR(filename) = "" then
    'file doesn't exist.
else
    'file does exist
    'continue processing
endif


Quote:
> Is there an API function to determine if a string would make a valid file
> name?

> Mike T.



Mon, 16 Dec 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST

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

3. valid filenames for shell functions?

4. Valid Filenames?

5. Checking for valid filename

6. Detecting if a filename is a valid picture file

7. Converting an invalid filename to a valid one

8. check string as valid filename

9. Valid FileName

10. Testing for valid date enry

11. test if a record is valid before updating...

12. Test for valid directory?

 

 
Powered by phpBB® Forum Software