Browse Source

Added FileExists() function.

Brucey 1 year ago
parent
commit
653acae6f7
1 changed files with 9 additions and 0 deletions
  1. 9 0
      filesystem.mod/filesystem.bmx

+ 9 - 0
filesystem.mod/filesystem.bmx

@@ -235,6 +235,15 @@ Function FileType:Int( path:String )
 	Return FILETYPE_NONE
 	Return FILETYPE_NONE
 End Function
 End Function
 
 
+Rem
+bbdoc: Checks if a file or directory exists
+returns: #True if the file or directory at @path exists
+about: Use #FileType to check if the file is a directory or a plain file.
+End Rem
+Function FileExists:Int( path:String )
+	Return FileType( path ) <> FILETYPE_NONE
+End Function
+
 Rem
 Rem
 bbdoc: Gets file time
 bbdoc: Gets file time
 returns: The time the file at @path was last modified.
 returns: The time the file at @path was last modified.