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: 12.1   12.2   12.3   12.4   12.5   13.0   13.1   13.2   13.3   13.4    Statistic    FMM    Blog  

Files.CreateHardLink

Creates a new hard link.

Component Version macOS Windows Linux Server iOS SDK
Files 6.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "Files.CreateHardLink"; DestPath; TargetPath )   More

Parameters

Parameter Description Example
DestPath The path where to create the hard link file. "/Users/cs/Desktop/test.rtf"
TargetPath The target path for the link. "/Users/cs/Desktop/todo.rtf"

Result

Returns OK or error.

Description

Creates a new hard link.
On success, you get two directory entries which point to same data on disk.
For Macs works with file and folders.
Be aware that not all applications are aware to handle hard links for folders correctly!

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

Creates a hard link:

MBS( "Files.CreateHardLink"; "/Users/cs/Desktop/test.rtf"; "/Users/cs/Desktop/todo.rtf" )

Creates a hard link on Wijndows:

MBS( "Files.CreateHardLink"; "C:\Users\Christian\Desktop\other.jpg"; "C:\Users\Christian\Desktop\test.jpg")

See also

Blog Entries

This function checks for a license.

Created 7th June 2016, last changed 7th June 2016


Files.CreateDirectory - Files.CreateSymbolicLink

💬 Ask a question or report a problem