Mailing List Archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Perl Q: how to check if a file is "busy"

Thanks for the info. I'm guessing lsof is not part of a minimal install 
since I don't have it on my system. I'll look around to see if I can find 
which rpm gives it to me.


PS Is it secure or is it something best left off a machine I am trying to 

>From: Josh Glover <>
>Subject: Re: [tlug] Perl Q: how to check if a file is "busy"
>Date: Wed, 26 Jun 2002 12:20:52 -0400
>Jean-Christian Imbeault wrote:
>>I wrote a very simple perl program to mv some files around. But 
>>unfortunately it cannot tell when a file it is tryig to "mv" is currently 
>>being written to and shouldn't be moved until it is no longer bing written 
>>What are some mechanisms I can use to wait until a file is "free" before 
>>mv'ing it? Are there any system calls I could us that do this?
>How about lsof?
>lsof | grep filname
>There are probably more efficient ways to use lsof, and I sure they are 
>hiding somewhere in the terribly dense man page...
>Josh Glover <>
>Associate Systems Administrator

Join the world’s largest e-mail service with MSN Hotmail.

Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links