summaryrefslogtreecommitdiffstats
path: root/Mac
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1997-08-08 15:00:59 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1997-08-08 15:00:59 (GMT)
commit48f662de927de8523ef3618271fc289cf46d1f9b (patch)
tree201a73feed56f44255941699d86b3c0412ffbe77 /Mac
parent756a69fa0d3266e55537cfcf580dd4b1dc8617ea (diff)
downloadcpython-48f662de927de8523ef3618271fc289cf46d1f9b.zip
cpython-48f662de927de8523ef3618271fc289cf46d1f9b.tar.gz
cpython-48f662de927de8523ef3618271fc289cf46d1f9b.tar.bz2
mkalias() now has an optional third parameter to create relative
aliases (Just)
Diffstat (limited to 'Mac')
-rw-r--r--Mac/Lib/macostools.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/Mac/Lib/macostools.py b/Mac/Lib/macostools.py
index 46eef98..374d3f1 100644
--- a/Mac/Lib/macostools.py
+++ b/Mac/Lib/macostools.py
@@ -26,11 +26,16 @@ BUFSIZ=0x80000 # Copy in 0.5Mb chunks
# Not guaranteed to be correct or stay correct (Apple doesn't tell you
# how to do this), but it seems to work.
#
-def mkalias(src, dst):
+def mkalias(src, dst, relative=None):
"""Create a finder alias"""
srcfss = macfs.FSSpec(src)
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()
Res.FSpCreateResFile(dstfss, srcfinfo.Creator, srcfinfo.Type, -1)