]> granicus.if.org Git - python/commitdiff
mkalias() now has an optional third parameter to create relative
authorJack Jansen <jack.jansen@cwi.nl>
Fri, 8 Aug 1997 15:00:59 +0000 (15:00 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Fri, 8 Aug 1997 15:00:59 +0000 (15:00 +0000)
aliases (Just)

Mac/Lib/macostools.py

index 46eef98a96c55bf204f892e058a1327152f5efed..374d3f134d9dff16d115d0e1bdbb1a751939d2ed 100644 (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
 # 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)