Commit 31fc1eb9 authored by Jack Jansen's avatar Jack Jansen

Replaced touched(), which no longer seems to work under os9, with something...

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:-)
parent 5b0a626a
...@@ -58,7 +58,7 @@ def mkdirs(dst): ...@@ -58,7 +58,7 @@ def mkdirs(dst):
mkdirs(head) mkdirs(head)
os.mkdir(dst, 0777) os.mkdir(dst, 0777)
def touched(dst): def touched_old(dst):
"""Tell the finder a file has changed""" """Tell the finder a file has changed"""
file_fss = macfs.FSSpec(dst) file_fss = macfs.FSSpec(dst)
vRefNum, dirID, name = file_fss.as_tuple() vRefNum, dirID, name = file_fss.as_tuple()
...@@ -69,6 +69,15 @@ def touched(dst): ...@@ -69,6 +69,15 @@ def touched(dst):
now = now + 1 now = now + 1
dir_fss.SetDates(crdate, now, bkdate) 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): def copy(src, dst, createpath=0, copydates=1):
"""Copy a file, including finder info, resource fork, etc""" """Copy a file, including finder info, resource fork, etc"""
if createpath: if createpath:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment