Creating shortcuts?

R

Ron Griswold

Hi Folks,

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...).

Thanks,

Ron Griswold
Character TD
R!OT Pictures
(e-mail address removed)
 
D

Dennis Lee Bieber

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 link,
at that, I suspect -- as a hard link can be done using os.link(), 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 memory
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)


--
 
R

Roger Upole

On Windows, Pywin32 allows you to create and manipulate
shortcuts. See \win32comext\shell\test\link.py for a small
class that wraps the required interfaces.
hth
Roger

Hi Folks,

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...).

Thanks,

Ron Griswold
Character TD
R!OT Pictures
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top