Creating shortcuts?

Ron Griswold RGriswold at
Fri Jan 13 19:18:18 CET 2006

Hi Dennis,

Yes, I am equating a unix soft link to a windows shortcut. Both act as
links to a file or directory. 

I have found that windows shortcuts do appear in linux dir listings with
a .lnk extension, however the file is meaningless to linux. On the other
hand, a linux soft link does not appear in a windows directory listing,
not that I really want it to.

As for and os.symlink, these appear to be unix specific. It
would be nice if os.symlink, when run on windows, would create a


Ron Griswold
Character TD
R!OT Pictures
rgriswold at

-----Original Message-----
From: at
[ at] On Behalf
Of Dennis Lee Bieber
Sent: Friday, January 13, 2006 12:26 AM
To: python-list at
Subject: Re: Creating shortcuts?

On Thu, 12 Jan 2006 22:53:42 -0800, "Ron Griswold"
<RGriswold at> declaimed the following in comp.lang.python:

> Is it possible to create a shortcut to a file in Python? I need to do
> this in both win32 and OSX. I've already got it covered in Linux by
> system(ln...).

	Are you equating a Windows "shortcut" to a Unix "link"? Soft
at that, I suspect -- as a hard link can be done using, though
a soft link can be done with os.symlink(). Lets see if my terminology is
correct: a "hard link" is an additional directory entry pointing to a
pre-existing file (with a count of how many entries exist for the file);
a "soft link" is basically a special file that contains the full path to
the actual file (and hence, could cross file system boundaries).

	I don't think Windows "shortcuts" are the same thing (as my
struggles, I have vague inklings that NTFS actually supports Unix-like
links, but practically nothing uses them). At best, they may be similar
to a soft link, being a particular type of file, being that they are
files with a ".lnk" extension (and hidden by the OS normally)

 > ============================================================== <
 >   wlfraed at  | Wulfraed  Dennis Lee Bieber  KD6MOG <
 >      wulfraed at     |       Bestiaria Support Staff       <
 > ============================================================== <
 >           Home Page: <>            <
 >        Overflow Page: <>        <

More information about the Python-list mailing list