At the moment, the way I am doing it is with the pipe. The reason that I was looking for a more pure-perl implementation or a wrapped c-code implementation was that this is running in a script that sometimes runs MANY times (often simultaneously) (it's a ftp-server postprocessor). The need for the lsof call is that there is some apparent corruption happening on certain files (and they are all rijndael encrypted, hence 1 1 byte corruption is VERY bad!!) and it appears to me that the FTP server is holding open a file during a rename and I am processing the file prior to it flushing the buffer or something.
Tha bug is very frustrating, and also quite difficult to track down. It's a complex system involving PocketPC devices, a linux server running proftpd, plus lots of backend post-processing of the files created by the pocketpc devices...
Again, thanks for your input. If I find that the numerous piped lsof calls are putting to much of a strain on the server, I'll probably port it to a module (and CPAN it). Might be an interesting foray into the world of XS or inline c!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.