Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 9.5   10.0   10.1   10.2   10.3   10.4   10.5   11.0   11.1   11.2    Statistic    FMM    Blog  

Files.CanOpenFile

Checks if plugin can read file.

Component Version macOS Windows Linux Server iOS SDK
Files 5.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "Files.CanOpenFile"; Path )   More

Parameters

Parameter Description Example
Path The native file path to the file. $path

Result

Returns 1, 0 or error.

Description

Checks if plugin can read file.
The plugin tries to open file exclusive. If that fails another application or FileMaker has the file open.
Returns 1 if open was okay, 0 if file is busy or an error like permissions denied.

This function requires a native path. Use Path.FileMakerPathToNativePath to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use FileDialog functions.
For Server be aware that server has limited permissions and may not be able to access all files on a computer.

Examples

Check if file exists:

Show Custom Dialog ["File exists"; MBS( "Files.CanOpenFile"; "/Users/cs/Desktop/test.rtf" )]

See also

Blog Entries

Created 20th October 2015, last changed 18th October 2016


Files.AudioTags - Files.CopyFile

Feedback: Report problem or ask question.