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.CreateAlias

Creates an alias or link file.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Files 8.4 Yes Yes Yes No Yes

MBS( "Files.CreateAlias"; AliasFilePath; TargetPath { ; RelativeTo or WorkingPath } )

Parameters

Parameter Description Example value
AliasFilePath The path for the alias file path. "/Users/cs/Desktop/test"
TargetPath The target path to have the alias point to. "/Users/cs/Desktop"
RelativeTo or WorkingPath Optional
The folder path to use relative resolution for Mac or the working directory for Windows.
"/Users/cs"

Result

Returns OK or error.

Description

Creates an alias or link file.
If relative path is provided, the alias will include the relative path from that folder to the target item. When resolved later and the full path is invalid, the relative path may find it.

See Files.CreateSymbolicLink for creating symbol links and Files.CreateHardLink for hard links.

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

Create Alias:

MBS( "Files.CreateAlias"; "/Users/cs/Desktop/test"; "/Users/cs/Desktop" )

Creates link files on Windows:

MBS("Files.CreateAlias"; "C:\Users\Christian\Desktop\test.lnk"; "cmd.exe")

Create link for image file:

MBS("Files.CreateAlias"; "C:\Users\Christian\Desktop\test.lnk"; "C:\Users\Christian\Pictures\test.jpg")

See also

Created 9th September 2018, last changed 9th September 2018


Files.CopyFile   -   Files.CreateBookmark

Feedback: Report problem or ask question.




Links
MBS FileMaker Plugins