Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^10: Display filenames in mbox folder

by peterr (Scribe)
on Mar 02, 2015 at 03:55 UTC ( [id://1118359]=note: print w/replies, xml ) Need Help??


in reply to Re^9: Display filenames in mbox folder
in thread Display filenames in mbox folder

After testing the above script, and had no output for a KMail folder, I realised it is not recursive. There are sub-folders like ..

/cur

/new

/tmp

That is why it hasn't been working for me. :D

Once I specified the exact path, the pattern worked fine, and I was able to push out all the filenames. It totalled 591 which is what I expected. Then wrote a script to compare that output with another "ls". The "culprit" file turned out to be one with a filename of "1232706568.2627.1XNmk~:2,S". It was from 2008; possibly KMail had a hiccup back then and wrote a filename with a "tilde" in it. Will rename the file and get rid of the tilde in the filename (and any others).

The issue with recursion was also true for the sub readMessageFilenames, in that it doesn't do a recursive search. Once I set it to the exact pathname, the pattern worked fine. Although that means I have to run it for every sub folder. I did try adding "-r" to grep { -f "$PATH/$_" && /^([0-9][\w.:,=\-]+)$/ } but got an error. Thanks for all your help. :)

Replies are listed 'Best First'.
Re^11: Display filenames in mbox folder
by choroba (Cardinal) on Mar 02, 2015 at 09:00 UTC
    I realised it is not recursive
    Use File::Find and friends for recursive directory traversal.
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1118359]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2024-04-16 05:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found