]> granicus.if.org Git - python/commitdiff
Replaced touched(), which no longer seems to work under os9, with something using...
authorJack Jansen <jack.jansen@cwi.nl>
Fri, 9 Feb 2001 15:58:34 +0000 (15:58 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Fri, 9 Feb 2001 15:58:34 +0000 (15:58 +0000)
Mac/Lib/macostools.py

index c6035b4052aa6bd6b04a4ab0f8cd53ffbd8465d0..9fc3a4999de8df161be2a131e490c727006edc11 100644 (file)
@@ -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: