summaryrefslogtreecommitdiffstats
path: root/Mac/Lib
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2001-03-06 22:46:25 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2001-03-06 22:46:25 (GMT)
commitc1463c98709bb62c6135f6e22afccdcc3fc765a7 (patch)
treed966b5128b9d669f07c88480a7d1f55e2c4e99f2 /Mac/Lib
parentbb74f95821406c3fbd970561c719fa70c02521b5 (diff)
downloadcpython-c1463c98709bb62c6135f6e22afccdcc3fc765a7.zip
cpython-c1463c98709bb62c6135f6e22afccdcc3fc765a7.tar.gz
cpython-c1463c98709bb62c6135f6e22afccdcc3fc765a7.tar.bz2
macostools.copy() now has an optional forcetype flag, which sets the filetype. This is used by various tools to set the type to APPL when copying interpreter template files (Atmp filetype).
Diffstat (limited to 'Mac/Lib')
-rw-r--r--Mac/Lib/macostools.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Mac/Lib/macostools.py b/Mac/Lib/macostools.py
index 5b12fc0..d706856 100644
--- a/Mac/Lib/macostools.py
+++ b/Mac/Lib/macostools.py
@@ -78,7 +78,7 @@ def touched_ae(dst):
dir_fss = macfs.FSSpec((vRefNum, dirID, ''))
f.update(dir_fss)
-def copy(src, dst, createpath=0, copydates=1):
+def copy(src, dst, createpath=0, copydates=1, forcetype=None):
"""Copy a file, including finder info, resource fork, etc"""
if createpath:
mkdirs(os.path.split(dst)[0])
@@ -106,6 +106,8 @@ def copy(src, dst, createpath=0, copydates=1):
sf = srcfss.GetFInfo()
df = dstfss.GetFInfo()
df.Creator, df.Type = sf.Creator, sf.Type
+ if forcetype != None:
+ df.Type = forcetype
df.Flags = (sf.Flags & (kIsStationary|kNameLocked|kHasBundle|kIsInvisible|kIsAlias))
dstfss.SetFInfo(df)
if copydates: