From a2168eceb0277f767877a0845537f6564f0410a0 Mon Sep 17 00:00:00 2001 From: Just van Rossum Date: Sun, 10 Mar 2002 19:28:02 +0000 Subject: mkalias() now also works for folders. Fixes bug #515830. --- Mac/Lib/macostools.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Mac/Lib/macostools.py b/Mac/Lib/macostools.py index 72f2032..43ab74f 100644 --- a/Mac/Lib/macostools.py +++ b/Mac/Lib/macostools.py @@ -34,9 +34,13 @@ def mkalias(src, dst, relative=None): alias = srcfss.NewAlias(relativefss) else: alias = srcfss.NewAlias() - srcfinfo = srcfss.GetFInfo() - - Res.FSpCreateResFile(dstfss, srcfinfo.Creator, srcfinfo.Type, -1) + + if os.path.isdir(src): + cr, tp = 'MACS', 'fdrp' + else: + cr, tp = srcfss.GetCreatorType() + + Res.FSpCreateResFile(dstfss, cr, tp, -1) h = Res.FSpOpenResFile(dstfss, 3) resource = Res.Resource(alias.data) resource.AddResource('alis', 0, '') -- cgit v0.12