mkalias() now has an optional third parameter to create relative

aliases (Just)
This commit is contained in:
Jack Jansen 1997-08-08 15:00:59 +00:00
parent 756a69fa0d
commit 48f662de92
1 changed files with 7 additions and 2 deletions

View File

@ -26,11 +26,16 @@ BUFSIZ=0x80000 # Copy in 0.5Mb chunks
# Not guaranteed to be correct or stay correct (Apple doesn't tell you # Not guaranteed to be correct or stay correct (Apple doesn't tell you
# how to do this), but it seems to work. # how to do this), but it seems to work.
# #
def mkalias(src, dst): def mkalias(src, dst, relative=None):
"""Create a finder alias""" """Create a finder alias"""
srcfss = macfs.FSSpec(src) srcfss = macfs.FSSpec(src)
dstfss = macfs.FSSpec(dst) dstfss = macfs.FSSpec(dst)
alias = srcfss.NewAlias() if relative:
relativefss = macfs.FSSpec(relative)
# ik mag er geen None in stoppen :-(
alias = srcfss.NewAlias(relativefss)
else:
alias = srcfss.NewAlias()
srcfinfo = srcfss.GetFInfo() srcfinfo = srcfss.GetFInfo()
Res.FSpCreateResFile(dstfss, srcfinfo.Creator, srcfinfo.Type, -1) Res.FSpCreateResFile(dstfss, srcfinfo.Creator, srcfinfo.Type, -1)