Definition: | integer res = get_file_type(string filename) |
Description: |
Get the type of a file or directory.
filename: the name of the file to query. It must not have wildcards (? and *). Returns an integer:
|
Comments: |
Both forwardslash ('/') and backslash ('\\') are handled for all platforms.
A trailing slash is optional on directories, it makes no difference whether one is present or not. The four return values above are automatically declared in psym.e/syminit(). |
Example: |
if get_file_type("C:/Program Files (x86)/Phix/builtins/vm/papnd.e")!=FILETYPE_FILE then ?9/0 end if if get_file_type("C:/Program Files (x86)/Phix/builtins/vm")!=FILETYPE_DIRECTORY then ?9/0 end if if get_file_type("C:\\Program Files (x86)\\Phix\\builtins\\vm\\")!=FILETYPE_DIRECTORY then ?9/0 end if |
See Also: | dir |
