[Pythonmac-SIG] For your eyes only - second time around

Jack Jansen Jack.Jansen@oratrix.com
Sun, 13 Oct 2002 13:37:45 +0200


On zaterdag, oktober 12, 2002, at 06:50 , Neil Mayhew wrote:
> So the problem is that the script is trying to touch the 
> /Library/CFMSupport
> directory, which isn't owned by me, so the script can't change 
> its dates.
>
> I made a temporary fix for this as follows:
>
> --- macostools.py 72 ---
>     try:
>         dir_fss.SetDates(crdate, now, bkdate)
>     except:
>         print "Could not touch", dir_fss.as_pathname()
>
> However, I see that there is a touched_ae(dst) in 
> macostools.py, which does
> it the proper way using AppleEvents, so a better solution would 
> presumably
> be to change copy() in macostools.py to use touched_ae instead 
> of touched.

Yes, but touched_ae is a lot slower. I can see two solutions:
- silently skip the SetDates() if it doesn't work. I think 
touched() isn't as important on OSX anyway (the finder seems to 
pick up changes must faster than on OS9).
- if SetDates() fails call touched_ae.

I think I prefer the first solution,
--
- Jack Jansen        <Jack.Jansen@oratrix.com>        
http://www.cwi.nl/~jack -
- If I can't dance I don't want to be part of your revolution -- 
Emma Goldman -