Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   Crossplatform   Server (Not)   Client   Components   Old   Guides
New in version: 4.0   4.1   4.2   4.3   4.4   5.0   5.1   5.2   5.3   5.4   6.0   6.1   6.2   6.3   6.4   6.5   7.0   7.1    Statistic  

Files.FileExists

Checks whether a file exists with the given path.

Component: Files
Version: 2.7
Mac OS X: Yes
Windows: Yes
Server: Yes
FileMaker Cloud: Yes

MBS( "Files.FileExists"; Path )

Parameters

Parameter Description Example value
Path Native path to the file to check. "C:\Windows"

Result

Returns 1 if file exists and 0 if not.

Description

Checks whether a file exists with the given path.
If item exists at the path Files.ItemExists returns 1. If it's a directory, Files.DirectoryExists also returns 1 and Files.FileExists returns 0. With a file, Files.FileExists returns 1 and Files.DirectoryExists returns 0.
This function needs a native path. Please use Path.FileMakerPathToNativePath function in order to convert a FileMaker style path to a native path.

For applications on Mac OS X, this function returns 0 as those are directories.

Examples

Checks whether file exists:

Set Variable [$r; Value:MBS( "Files.FileExists"; "/Users/cs/Desktop/test.rtf")]

See also


Files.FileDisplayName   -   Files.FileExtension

Feedback: Report problem or ask question.




Links
MBS REALbasic Plugins - Nachhilfe in Wassenach