Platforms to show: All Mac Windows Linux Cross-Platform
Back to MacAliasMBS class.
MacAliasMBS.AliasInfo as AliasInfoMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Alias | MBS MacClassic Plugin | 13.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Some examples using this method:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Alias | MBS MacClassic Plugin | 3.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
There is no need to call this method except you want to free all resources of this object now without waiting for Xojo to do it for you.
MacAliasMBS.Create(relPath as FolderItem, target as FolderItem, isDirectory as boolean = false) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Alias | MBS MacClassic Plugin | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Returns zero if successful, otherwise a negative Mac OS error code.
Version 16.0 can create alias for non existing files. In that case you can tell with function isDirectory whether the target should be a directory. Still returns fnfErr (-43) if file doesn't exist but the alias will still be created.
MacAliasMBS.CreateAliasFromPath(targetPath as string, fromFilePath as String = "", isDirectory as boolean = false) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Alias | MBS MacClassic Plugin | 16.0 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Returns OS error code.
If the target file does not exist but the path up to the leaf does then fnfErr (-43) will be returned but the alias will still be created.
fromFilePath: The starting point for a relative search.
targetPath: POSIX style UTF-8 path to target.
IsDirectory: On input, if target does not exist, a flag to indicate whether or not the target is a directory.
MacAliasMBS.CreateFSRef(relPath as memoryblock, target as memoryblock) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Alias | MBS MacClassic Plugin | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
The two memoryblocks are FSRefs which you can get by FolderItem.FSRef.
Returns zero if successful, otherwise a negative Mac OS error code.
MacAliasMBS.CreateMinimal(target as FolderItem, isDirectory as boolean = false) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Alias | MBS MacClassic Plugin | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Minimal creates an alias without path, so it is smaller.
Version 16.0 can create alias for non existing files. In that case you can tell with function isDirectory whether the target should be a directory. Still returns fnfErr (-43) if file doesn't exist but the alias will still be created.
MacAliasMBS.CreateMinimalFSRef(target as memoryblock) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Alias | MBS MacClassic Plugin | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
The memoryblock is a FSRefs which you can get by FolderItem.FSRef.
Returns zero if successful, otherwise a negative Mac OS error code.
MacAliasMBS.GetRecord as String
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Alias | MBS MacClassic Plugin | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Attention: The length of the String is not fixed! When the Alias changes, its length usually changes, too. If you want to save this string into a binary file, you must also save its current length so that you know how much bytes to retrieve if you read it back from the file later. An easier way to store Aliases in a file is by using the Resource Manager. The sample code "FolderItems in Preferences.rbp" shows how to accomplish this.
MacAliasMBS.PathString as String
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Alias | MBS MacClassic Plugin | 13.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
MacAliasMBS.Resolve(relPath as FolderItem, mode as Integer) as FolderItem
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Alias | MBS MacClassic Plugin | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
After calling this method, the property needsUpdate tells you whether the target has been renamed or moved, which suggests that you call Update in order to reflect the change in the AliasRecord. See the demo "FolderItems in Preferences.rbp" for an example.
MacAliasMBS.SetRecord(record as String)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Alias | MBS MacClassic Plugin | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Some examples using this method:
MacAliasMBS.TargetName as String
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Alias | MBS MacClassic Plugin | 13.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
MacAliasMBS.Update(relPath as FolderItem, target as FolderItem) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Alias | MBS MacClassic Plugin | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
MacAliasMBS.VolumeName as String
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Alias | MBS MacClassic Plugin | 13.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
The items on this page are in the following plugins: MBS MacClassic Plugin.