This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v19.8
file.createAlias( )
|
file.createAlias ( destinationFolder ; aliasName {; aliasType} ) -> Result | ||||||||
Parameter | Type | Description | ||||||
destinationFolder | Object |
![]() |
Destination folder for the alias or shortcut | |||||
aliasName | Text |
![]() |
Name of the alias or shortcut | |||||
aliasType | Longint |
![]() |
Type of the alias link | |||||
Result | Object |
![]() |
Alias or shortcut file reference | |||||
The file.createAlias( ) method creates an alias (macOS) or a shortcut (Windows) to the file with the specified aliasName name in the folder designated by the destinationFolder object.
Pass the name of the alias or shortcut to create in the aliasName parameter.
By default on macOS, the method creates a standard alias. You can also create a symbolic link by using the aliasType parameter. The following constants are available:
Constant | Value | Comment |
fk alias link | 0 | Alias link (macOS only)(default) |
fk symbolic link | 1 | Symbolic link (macOS only) |
On Windows, a shortcut (.lnk file) is always created (the aliasType parameter is ignored).
Returned object
The file.createAlias( ) method returns a File object with the file.isAlias property set to true.
You want to create an alias to a file in your database folder:
$myFile:=Folder(fk documents folder).file("Archives/ReadMe.txt")
$aliasFile:=$myFile.createAlias(File("/PACKAGE");"ReadMe")
Product: 4D
Theme: File and Folder
Created: 4D v17 R5
4D Language Reference ( 4D v19)
4D Language Reference ( 4D v19.1)
4D Language Reference ( 4D v19.4)
4D Language Reference ( 4D v19.5)
4D Language Reference ( 4D v19.6)
4D Language Reference ( 4D v19.7)
4D Language Reference ( 4D v19.8)