2 May 2007 05:39
Re: Monitoring files (cont.)
Charles Galpin wrote:
> ...it just sounds like you want to get the
> file count, do a directory listing and keep checking until the count
> matches (sleeping inbetween), then use lsof to make sure they are not
> open before processing them. If lsof reports them opened by another
> process, it means they are still being copied, so you'd want to sleep
> and check again (or keep processing the other ones and come back to it).
>
Question, would lsof tell me the file's open if the process that
writing to it isn't on the same machine? See, the files that I'm
needing to check are being created on an NT box and all I have is access
(through CIFS) to the folder where those files are being created in. So
how would lsof know whether those files are open or not if the process
isn't on the same machine? Magic? ESP?
I think, and I say this with a touch of salt, but I think I can
simply count the files and go by that. The container files are very
small (less than 100 bytes) so it really doesn't take a whole lot of
time to write a file. So I think I'm safe in counting the files, and if
I get a matching count, I'm done and can move on to the next step which
is copying the actual image files over.
-- A
--
--
H | It's not a bug - it's an undocumented feature.
+--------------------------------------------------------------------
Ashley M. Kirchner <mailto:ashley@...> . 303.442.6410 x130
IT Director / SysAdmin / Websmith . 800.441.3873 x130
Photo Craft Imaging . 3550 Arapahoe Ave. #6
(Continue reading)
RSS Feed