Hi Gopal,

On Tuesday 23 November 2010 14:01:20 Gopal Karunakar wrote:
> Hi All,
> 
>     I want to check whether a particular file (a simple text file) is open
> in the UNIX environment. i.e. I want to make sure that its not getting
> written into by some other process before my Perl process open it. So that
> it will always get a complete file. Is there some way of making sure of
> this??
> 

See this thread:

http://www.nntp.perl.org/group/perl.beginners/2010/11/msg114616.html

Quoting my email:

{{{{{{{{{{{
On Tuesday 02 November 2010 20:49:04 perl_haxor 123 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.
> 

I don't know about Windows, but on UNIX you can use lsof:

http://en.wikipedia.org/wiki/Lsof

This page says that http://en.wikipedia.org/wiki/Process_Explorer is the 
Windows equivalent.

However, you should rethink your strategy. If you want well-behaving processes 
not to step on each others' toes you can use file locking for that.
}}}}}}}}}}

Regards,

        Shlomi Fish

-- 
-----------------------------------------------------------------
Shlomi Fish

<rindolf> She's a hot chick. But she smokes.
<go|dfish> She can smoke as long as she's smokin'.

Please reply to list if it's a mailing list post.

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to