{#}  Replies are directed back to [EMAIL PROTECTED]
{#}  To reply to the author, write to Theo Schlossnagle <[EMAIL PROTECTED]>

On Thursday, January 31, 2002, at 04:29  AM, Nick Kocharhook wrote:
> http://www.kocharhook.com/nick/fire/rename.html

Wow... That's a lot of work...  When I posted the change to the list 
about the sessions date string format change, I also posted a perl 
"one-liner" to fix old sessions.

find ~/Library/Application\ Support/Fire/Sessions/ -depth | perl -ni -e 
'chomp; ($n=$_) =~ s/\/(\d\d) (\d\d) (0\d), (...) (\d\d):(\d\d) 
(AM|PM)/"\/20$3-$1-$2, $4 ".(($7 eq "PM")?($5+12):($5)).":$6"/e && 
rename($_,$n);'

Did this not work for you?  I'd like to know if there is a bug in that 
logic.

Just as a note, in your script, in Step 3.  There is not reason not to 
FORCE a year 2000 date.  By matching (0\d) as $3 instead of (\d\d).  
That way, is someone were to have files that are from 19xx, it would not 
rewrite them as 20xx!  Your script does that... :-)

> I mention this several times on that page, but PLEASE, PLEASE back up 
> your
> files before attempting this.

Always a _smart_ thing to do.

> This will probably only be useful to people who are running cvs builds 
> at
> the moment. As long as the naming scheme doesn't change, though, it 
> will be
> perfectly valid once the next version makes it out the door.

Also note that running your script or my command several times won't 
munge anything.  They both only update files that are in the old 
format... So, if none exist, nothing bad will happen.

--
Theo Schlossnagle
1024D/82844984/95FD 30F1 489E 4613 F22E  491A 7E88 364C 8284 4984
2047R/33131B65/71 F7 95 64 49 76 5D BA  3D 90 B9 9F BE 27 24 E7


{#} ----------------------------------------------------+[ fire ]+---


Reply via email to