File open?
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > File open?




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    File open?  
John Estess


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-09-05 10:53 PM

Is there a standard way to determine if any given file is opened for
reading or writing (or both)? I would like to ftp a file after I
determine that the file is no longer being written to by a daemon
process I have no control over. Is that possible? Thank you.

jhestess@yahoo.com





[ Post a follow-up to this message ]



    Re: File open?  
Fletcher Glenn


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-09-05 10:53 PM

John Estess wrote:
> Is there a standard way to determine if any given file is opened for
> reading or writing (or both)? I would like to ftp a file after I
> determine that the file is no longer being written to by a daemon
> process I have no control over. Is that possible? Thank you.
>
> jhestess@yahoo.com

If you're writing a script, you might look at the fuser command.

--

Fletcher Glenn






[ Post a follow-up to this message ]



    Re: File open?  
SM Ryan


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-09-05 10:53 PM

John Estess <jestess@elp.rr.com> wrote:
# Is there a standard way to determine if any given file is opened for
# reading or writing (or both)? I would like to ftp a file after I
# determine that the file is no longer being written to by a daemon
# process I have no control over. Is that possible? Thank you.

A portable way is to stat the file periodically and wait until
the mtime, size, and dev:ino do not change for some interval.

--
SM Ryan http://www.rawbw.com/~wyrmwif/
So....that would make Bethany part black?





[ Post a follow-up to this message ]



    Re: File open?  
Måns Rullgård


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-09-05 10:53 PM

Fletcher Glenn <fletcher@removethisfoglight.com> writes:

> John Estess wrote: 
>
> If you're writing a script, you might look at the fuser command.

Anything can happen between the time you check it and the time you
start doing things based on the check.

--
Måns Rullgård
mru@inprovide.com





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 03:26 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register