[Pythonmac-SIG] resolve alias

Jack Jansen jack@oratrix.nl
Mon, 10 Sep 2001 12:28:41 +0200


> Well...I created a file on the desktop, dragged an alias of it to a
> "src" folder and fed the path to that alias to the macostools.copy().  The
> alias itself is copied to the destination folder (dst), not the 
> original. How can I get the original to copy instead of the alias?
> Did I misread the docs?

No, you didn't misread the docs, the docs were just wrong. They've been fixed:
if you copy an alias file you copy the alias file, not what it is pointing to.

> I read a bit more and found the ResolveAliasFile routine...I used it 
> to obtain the fss for this file and then tried to use Resolve to get
> the actual path to the file that is on the desktop.

You don't have to do that. ResolveAliasFile does all the work for you: you 
pass in the pathname or fsspec for the alias file, you get out the fsspec for 
the file it points to.

Resolve() is only needed if you have an alias object, for instance created 
with fsspec.NewAlias().

--
Jack Jansen             | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.cwi.nl/~jack        | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm