
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"
- Date: Wed, 26 Jun 2002 12:20:52 -0400
- From: Josh Glover <jmglov@example.com>
- Subject: Re: [tlug] Perl Q: how to check if a file is "busy"
- References: <F235gdGx5dpjLBSP3d80000000b@example.com>
- Organization: INCOGEN, Inc.
- User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020606
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 to.
>
> 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 <jmglov@example.com>
Associate Systems Administrator
INCOGEN, Inc.
Home |
Main Index |
Thread Index