Hi All,

         Thanks a lot for the suggestion,  It looks like flock is used if my
perl script want to lock a file, In this case the perl script would be
copying files from one directory to an another one, but some process (let
say xyz process) might be using these files, in that case i don't want to
copy the file used by another process (xyz process).......please let me know
how can i find out if  file is locked by the process (xyz)?......can flock
be used for that....and also the system is linux system.


Thanks,
Monnappa

On Wed, Nov 3, 2010 at 1:31 AM, shawn wilson <ag4ve...@gmail.com> wrote:

> ---------- Forwarded message ----------
> From: "shawn wilson" <ag4ve...@gmail.com>
> Date: Nov 2, 2010 3:12 PM
> Subject: Re: checking if a file is in use
> To: "perl_haxor 123" <perl.ha...@gmail.com>
>
> perlmonks has a nice article on file locks in general that might be useful
> to you. i assume what you want to do is lock the file or die.
> http://www.perlmonks.org/?node_id=7058
>
>
> On Tue, Nov 2, 2010 at 2:49 PM, perl_haxor 123 <perl.ha...@gmail.com>
> wrote:
>
> > Hi All,
> >
> >          I have a directory in which i have multiple files, i have to
> read
> > each one of them and parse the data......but there could be some files
> > which
> > are in use by some other program, how can i find which files are in use
> by
> > other program in perl?.......any suggestions would be really helpful.
> >
> >
> >
> > Thanks,
> > Monnappa
> >
>

Reply via email to