Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Alias (Mac OS)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Alias record structure outside of size length === The following is for use with the Apple's Alias Resource Manager. # 4 bytes resource type name = long ASCII text string # 2 bytes resource ID = short integer value # 2 bytes resource end pad = short value set to zero '''Java code to flag an alias file''' <syntaxhighlight lang="java"> // This function checks whether a file matches the alias magic number. public static boolean checkForMacAliasFile(File inputFile) throws FileNotFoundException, IOException { // Only files can be aliases. // Do not test directories; they will be false. if (inputFile.isFile()) { byte[] bookmark = new byte[] { 0x62, 0x6F, 0x6F, 0x6B, 0x00, 0x00, 0x00, 0x00, 0x6D, 0x61, 0x72, 0x6B, 0x00, 0x00, 0x00, 0x00 }; long length = inputFile.length(); if (length > 16) { byte[] result = new byte[16]; FileInputStream fis = new FileInputStream(inputFile); fis.read(result); fis.close(); return Arrays.equals(result, bookmark); } } return false; } </syntaxhighlight> There is a [https://github.com/davecotter/cftest/blob/main/source/shared/MacAlias.cpp github repo with working C++ code here].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)