Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 7.1   7.2   7.3   7.4   7.5   8.0   8.1   8.2   8.3   8.4    Statistic  

Files.CanOpenFile

Checks if plugin can read file.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Files 5.4 Yes Yes Yes Yes Yes

MBS( "Files.CanOpenFile"; Path )

Parameters

Parameter Description Example value
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

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


Files.AppPath   -   Files.CopyFile

Feedback: Report problem or ask question.




Links
MBS Xojo PDF Plugins