Question about Dock?


Recommended Posts

There is one difference between shortcuts and aliases: Aliases don't get broken.

On Windows make a shortcut on your desktop to Microsoft Word (c:\program files\microft office\office\winword.exe IIRC). Move the office folder to say C:\Microsoft Office. Double click on the shortcut and marvel at the error message as it asks you to figure out what the heck went wrong and fix the shortcut.

On Mac OS Mac an alias to Microsoft Word (/Applications/Microsoft Office X/Microsoft Word) on your desktop. Move the office folder to the root directory (/Microsoft Office) and then double click the alias; everything keeps on chugging as it should. OS X resolves aliases whenever you click on them so they always work unless you delete the original. Then you get the error message: 'The alias "Alias Name" could not be opened because the original item cannot be found." [Delete Alias] [Fix Alias] [OK]

Aliases keep working even if you rename the original folder. This is a pretty common behavior in _most_ OS X applications. In VLC the recently opened documents list in the file menu will always work, even if you move or rename the file it will automagically update. If the files are erased then those entries are removed from the list.

What is the difference between symbolic links and aliases?

Link to comment
Share on other sites

I have already got a mac LOL :laugh: but you are right i don't minimize stuff very rarely in-fact, i leave it all in the background and use expose to find it the windows i want or use CMD + Tab.

Yep, I never minimize unless I am board and what to see the effect, lol.

Hide and Expose are a lot faster.

Link to comment
Share on other sites

What is the difference between symbolic links and aliases?

There is a simple answer, and a complex answer. I'm sure most regulars know that I suck at simple so I'll skip straight to complex.

On HFS and HFS+ file systems every file and folder has a unique ID that never changes as long as the file or folder exists, information like filename, date, icon, and size are all secondary characteristics of that file. On other platforms (Windows/UNIX) use the file name as the primary 'handle' it's a subtle difference but it lets HFS do a lot of cool tricks.

Aliases hold a link to the unique id of a file: why you double click on it, the operating system takes that ID, asks the file system for that object and then filesystem returns it. No matter where you move that file, or how you name it the ID will always be the same so the filesystem will always return the same object during resolution.

Symbolic links are a lot more simple. Think of them as a text file that holds the name and path of another file or path. The file /etc/mylink contains "/etc/some/file.txt". When you try to open /etc/mylink the file system looks inside and returns "/etc/some/file.txt" and try to open that instead. if "/etc/some/file.txt" has been moved and (or) renamed to say /system/missing.txt" the file system will still try to open "/etc/some/file.txt", if that file doesn't exist the link will be broken.

Why would you want to use symbolic links?

1) They're extremely small. An OS X alias will be a full Kb or two, more if you attach custom icons, a symbolic link will typically be a only a few bytes.

2) Symbolic links are very fast - because they don't have to go through the resolution processes they are almost instant. Aliases are equally fast from an end users perspective, but if you were to hit one 10,000 times a day, the sym-link would be a better choice.

3) UNIX systems understand them.

4) They don't have those stupid little arrows to ugly up your finder windows.

Why use aliases?

1) They don't break

2) Both aliases and symbolic links will eat up 4kb on disk not matter what so you might as well fill it with something

3) You can create aliases from the finder, sym-links force you to mess around in the terminal.

4) Classic Mac OS understands them (and it does not understand sym-links)

5) they have that nice little arrow so you know it's an alias not the original so you don't delete things by mistake.

You can find out more information about the Mac OS file system and specifically about aliases and symbolic link semantics at the Apple developer site.

A more detailed explanation (and probably more accurate) description is in thesystem overview. I haven't read that document since Xcode was ProjectBuilder so if your job depends on the difference I'd read up there before taking my word for it.

Link to comment
Share on other sites

nice explanations evn :), never knew that alias are so cool... never really used them. but how do i create a symbolic link?

Link to comment
Share on other sites

you use the terminal "ln" command (which stands for "link") with the "-s" flag to make a symbolic link. There are two kinds of links: symbolic and hard, but that's probably best left for a topic in the *NIX forums.

Anway, let's say you want to create a symbolic link to the applications folder on your desktop called "apps-link". For this you're going to need to open up terminal (in /applications/utilities). You enter the command "ln -s <target file or folder> <link location and name>

Last login: Sun May 23 00:43:22 on ttyp1
Welcome to Darwin!
(evn@evnbook : ~)$ ln -s /Applications /Users/evn/Desktop/Apps-link

In that example the "ln -s" part runs the make-link command with the "make a symbolic link" flag.

The "/applications" is the location we want the link to point to.

and "/Users/evn/Desktop/" is the path to my desktop

"App-link" is the name of the link.

You're username probably isn't "evn" so the path to your desktop is going to be different. This command should work for everyone:

ln -s /Applications/ ~/Desktop/sym-links-rule

the "~" in the *NIX world is a shortcut that always return the current users home directory. On OS X that is /Users/<yourshortname>, on most Linux/BSD systems that will be something like /home/<yourloginname> or /root depending on how you log in. If you're logged in as "steve" then ~ will be "/Users/steve" and when susan is logged into the same machine it will be "/Users/susan". Those UNIX guys think of everything!

You can do the same thing with files or applications. For example, if you wanted to create a sym-link to keychain access on your desktop (and who doesn't?) then this command would do the job:

ln -s /Applications/Utilities/Keychain\ Access.app ~/Desktop/Passwords

The symlink would be called "Passwords". Note that the 'space' in "Keychain Access" has a backslash in front off it: that's called escaping - it tells the application that the next character has a special meaning, and not to be treated normally. The normal action for a space is to act as a delimitation character between commands and parameters (ie: in the ln command the space seperates the command name "ln" from the "-s" flag and the target path from the link path/name). By escaping the the space we tell the shell to treat the space as part of the filename, not as a separator between commands. In the UNIX world spaces in file names are rare - though they are valid - which is why we need to dance through the hoops.

I think I've gone on a little too long again, so I'll sign off with a "good luck" and enjoy.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.