At 09:47  -0700 2009/05/03, Joey K Tuttle wrote:
>At 23:45  +0800 2009/05/03, bill lam wrote:
>  >
>>I can reproduce this error, try fixing by changing line 345 of jmf.ijs to
>  >  fh=. >0 { c_open fn;(ro{O_RDWR,O_RDONLY);0
>  >
>>>   iMg5:~ jkt$ #  Note that mod date is unchanged even though time 
>>>has gone by
>>
>>Timestamp changed in my debian linux. Is it a problem of mac itself?
>>
>  >--
>
>date of my jmf.ijs on all systems:
>
>-rw-r--r--@  1 jkt  admin  14607 Mar  4  2008 jmf.ijs
>
>
>Interesting observation about mod date - it does fail for me in Mac
>OS and Redhat Linux - but maybe the answer is that there is an
>updated version of jmf.ijs that would explain both things...
>

~~~
Bill,

When I looked, there was indeed an updated jmf.ijs - using it and 
making your suggested modification solved the RO issue.

Thanks!

---

Still the mod date is unchanged - are you perhaps in a 64 bit 
environment? That might explain why it fails in OS X and Redhat 32 
bit - and also Windows as Ric reported.

I realize this means I need to pay much closer attention to updates - 
Microsoft, Linux, and Apple coddle us by persistently updating things 
(sometimes when we would rather they didn't...)

---

The back story for why I was trying to map a RO file maybe worth 
telling. I keep my incoming email on my mail server (minus spam that 
is deleted by my email client). Each month, I archive the months 
worth of mail. Recently the volume has gotten out of hand and this 
month it was around 174 megabytes (ridiculous!).

I try to make the archive exactly fit the month, but when I use Unix 
mail to trim such a large file, it panics (because of the size) and 
destroys the mailfile (charming!). I learned this in the past, so my 
process is to copy the mbox, make it read only and then start the 
"clean up".

Sure enough, again this month mail destroyed the file - so I copied 
it back and used vi to edit it. This is OK, but  after about 25 
minutes (of processor time!) vi was still grinding away trying to 
delete about 2.4e6 lines - so I decided to take an alternative 
approach.

Using j, I did the following (on my slow 400 MHz server):

[...@focus mail]$ j6
    version ''
j602/2008-03-03/16:45
Running in: Linux
Installer: j602a_linux32.sh
Engine: j602/2008-03-03/16:45
Library: 6.02.023Linux version 2.4.20-28.8 
([email protected]) (gcc version 3.2 20020903 (Red Hat 
Linux 8.0 3.2-7)) #1 Thu Dec 18 12:53:39 EST 2003

    ts = 6!: 2

    require 'jmf'

    2 map_jmf_ 'mail';'mbox04';'';1
    $mail
175020422

    ts 'messageindex =. 0, I. (LF,''From'') E. mail'
7.91153

    $messageindex  NB. the index of each email in mbox format.
4780
    5 {. messageindex
0 2006 3909 5394 5826
    _5{. messageindex
175007347 175011519 175013600 175015093 175016184
    NB. find the first May message (the first to keep).

    ts 'firstmay =. I. ''Fri May  1'' E. mail'
7.0865

    5 {. firstmay
174347238 174350775 174355384 174361288 174367703

    messageindex I. {. firstmay NB. the next message after the one we want.
4669

    ((4668{messageindex) + i.128){mail     NB. checking our assumption

>From 
listbox+trampoline+q4+efym+mhg2-x023hg9_v5chwygua+dl7...@jeeves.archives.listbox.com
 
Fri May  1 00:02:40 2009
Return-Path

    ir
1!:11

    ((ir 'mbox04';0 2006), ir 'mbox04';4668{messageindex) fwrite 'newmbox'

    exit 0

---

What was done above was to locate the beginning index of each of the 
4780 messages in the mbox file, then find the first one to keep in 
the May version of the new mbox. The reason for keeping the fist 
message of the old box as the beginning of the new was to retain the 
imap flags so that my email client wouldn't get confused and download 
messages it had done previously.

Anyway, nitty gritty detail about managing mail files, but the 
satisfying thing was that the vi (editory) process continued to run 
all through thinking of an alternative approach, implementing it in a 
j session, finishing the job by creating a new mbox file. All of this 
took under 5 minutes of elapsed time (and less than 30 seconds of 
processor time) -- by then the vi process had accumulated 30 minutes 
of processor time and still wasn't finished! (I killed it with a 
smile. :)

I think there are many such stories that are entertaining, but not 
organized well enough to impress "the real world" - maybe because 
they solve "problems" that no one cares about (unless they have the 
problem).

I miss the j conferences where at least a room full of people could 
exchange such experiences. But even those are probably not effective 
at really "spreading the word"....

- joey

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to