anyone know of a possible perl builtin / function that will show a process holding a fileopen. I looked thru stat and lstat but still unable to find something similar to lsof. Any suggestions? Thanks
On which operating system ? Are you just trying to implement kind of [tt]lsof[/tt] in Perl, or you have some special requirement ? Neither [tt]fuser[/tt] solves your problem ?
If you want to code it yourself, iterate over the files matching [tt]^/proc/\d+/fd/\d+$[/tt] and use [tt]readlink()[/tt] on each to find out whether they point to the file in question.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.