UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

#1 2009-10-08 08:05 AM

swapnil
Member
Registered: 2009-10-08
Posts: 4

Re: File access by process

Offline

#2 2009-10-08 09:01 AM

i3839
Oddministrator
From: Amsterdam
Registered: 2003-06-07
Posts: 2,239

Re: File access by process

The job that writes to the file should make clear that it's done.
E.g. rename the file from $file.tmp to $file or something similar.
But if you have that much control over things you can also let it
upload the file to your machine directly.

The above is easiest done by wrapping the job with a script that
does the additional work when the main job is done, or add it to
the end of the current job script. Don't forget about error cases.

That said, a process that hangs for 15 minutes is a bad sign and
either something is very wrong, or there's a silly bug. Or the job
just gets too much work and can't finish it within 15 minutes.
Either way, you should find out what's really going on.

Offline

#3 2009-10-08 09:39 AM

swapnil
Member
Registered: 2009-10-08
Posts: 4

Re: File access by process

Offline

#4 2009-10-08 01:28 PM

swapnil
Member
Registered: 2009-10-08
Posts: 4

Re: File access by process

I have searched on net and I found that  'lsof |grep FILE_NAME' (list of open files) is command which gives file is open or not.I am using Solaris 5.10 which is not supporting this command so I need alternate solution. Please help .

Offline

#5 2009-10-08 01:43 PM

RobSeace
Administrator
From: Boston, MA
Registered: 2002-06-12
Posts: 3,839
Website

Re: File access by process

Offline

#6 2009-10-08 04:27 PM

swapnil
Member
Registered: 2009-10-08
Posts: 4

Re: File access by process

>Does this process that's writing to the file exit when finished? If so, you could just
>look to see whether or not the process is currently running, via "ps" or something...

as I told earlier, I don't have direct access to unix file I am using j2ssh to access remote log file ...........please suggest anather solution.........

(see above ,start of thread)

Offline

#7 2009-10-08 07:00 PM

RobSeace
Administrator
From: Boston, MA
Registered: 2002-06-12
Posts: 3,839
Website

Re: File access by process

Um, well you suggested you could run "lsof", so why couldn't you run "ps" as well??
If it's a full interface to SSH, then you should be able to run remote commands like
that... *shrug*

Offline

Board footer

Powered by FluxBB