On 04/27/2013 09:38 PM, Steven D'Aprano wrote:
On 28/04/13 04:53, fo...@yahoo.com wrote:
IIRC, os.symlink is not present in Python on Windows, right? (I'm on
vacation now so I can't check this). But aren't soft links and
shortcuts linux and windows terms for the same thing?
No, although they play similar roles.
Windows shortcuts are ordinary files with a .lnk extension. The content
of the file points to another file on disk. Windows opens the file,
looks inside to find out what target to look for, then looks for the
target. That makes them somewhat like Mac OS aliases, only not as smart.
(Mac aliases can actually keep tracking a file if you move it from
location to location, even from disk to disk.)
Symbolic (soft links) links are file system features, which means that
strictly speaking they depend on the file system, not the operating
system. Unlike shortcuts or aliases, which are files, sym links exist in
the file system metadata, which makes them smaller, faster to access,
and more efficient.
Hard links are also file system features. Essentially, a hard link is a
way to give a single file two names. If you think of the file system as
a tree of file names pointing to storage locations on disk, hard links
are two names pointing to a single location.
A little known fact: NTFS does support symbolic links, at least under
Windows 7 and Vista. NTFS sym links have some limitations compared to
POSIX (Unix, Mac, Linux, etc.) sym links, the biggest being that they
don't work during boot-up.
And another little-known fact -- NTFS supports hard links, or at least
it did in 1995, on NT 3.5 As I recall, there wasn't support at the cmd
prompt, but you could create them with system calls.
--
DaveA
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor