summaryrefslogtreecommitdiffstats
path: root/Mac/Lib
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2001-02-09 15:58:34 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2001-02-09 15:58:34 (GMT)
commit7e31f68bf1f348f43268d1fec62abc876b267ddb (patch)
tree8dcc8df161d399f4ba51f35e510eb16e66e32a26 /Mac/Lib
parent34f83b3f564eb95119b78a97d692f7293a8f8680 (diff)
downloadcpython-7e31f68bf1f348f43268d1fec62abc876b267ddb.zip
cpython-7e31f68bf1f348f43268d1fec62abc876b267ddb.tar.gz
cpython-7e31f68bf1f348f43268d1fec62abc876b267ddb.tar.bz2
Replaced touched(), which no longer seems to work under os9, with something using an appleevent to the finder. More expensive, but at least it works:-)
Diffstat (limited to 'Mac/Lib')
-rw-r--r--Mac/Lib/macostools.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/Mac/Lib/macostools.py b/Mac/Lib/macostools.py
index c6035b4..9fc3a49 100644
--- a/Mac/Lib/macostools.py
+++ b/Mac/Lib/macostools.py
@@ -58,7 +58,7 @@ def mkdirs(dst):
mkdirs(head)
os.mkdir(dst, 0777)
-def touched(dst):
+def touched_old(dst):
"""Tell the finder a file has changed"""
file_fss = macfs.FSSpec(dst)
vRefNum, dirID, name = file_fss.as_tuple()
@@ -69,6 +69,15 @@ def touched(dst):
now = now + 1
dir_fss.SetDates(crdate, now, bkdate)
+def touched(dst):
+ """Tell the finder a file has changed"""
+ import Finder
+ f = Finder.Finder()
+ file_fss = macfs.FSSpec(dst)
+ vRefNum, dirID, name = file_fss.as_tuple()
+ dir_fss = macfs.FSSpec((vRefNum, dirID, ''))
+ f.update(dir_fss)
+
def copy(src, dst, createpath=0, copydates=1):
"""Copy a file, including finder info, resource fork, etc"""
if createpath: