On most Unix systems there's a a "fuser" command which tells who is
accessing a file.
The rename method is superior, however. It also protects you against FTP
transfers which abort. As long as you automate it, there shouldn't be any
problem.
----- Original Message -----
From: "Paul Christidis" <[log in to unmask]>
To: <[log in to unmask]>
Sent: Monday, March 15, 2004 4:00 PM
Subject: [HP3000-L] Temporary files and Unix
> Folks,
>
> I know that the concept of 'temp' files does not exist in Unix. So I'd
> like to ask for ideas on how to handle the following situation.
>
> We have a Unix based 'report viewing' system where we sent reports from
our
> HP3000. Recently we've attempted to also sent there reports from SAP.
> Those SAP reports are requested and 'saved' on their PC, by a couple of
> support programmers, and then they are 'pushed' using FTP to the Unix
> server. On the server side a process, at regular intervals, checks for
> specific file names and then 'captures' the report into the 'viewing'
> system.
>
> The above has worked well for some time now. We've begun having some
> problems, however, when the programmers begun working from home. The FTP
> transfer takes longer that the repeat interval of the process that checks
> for 'new reports arrivals', and thus the process 'captures' only a portion
> of the report. The programmers have resorted to transfer the report to a
> fictitious name and renaming it to the correct name after the transfer
> completes. Sometimes, however, they forget to follow the two step method
> (since they don't have to do it when the transfer is performed from their
> office) and we end up with partial reports.
>
> So my question is:
> Is there a way in the Unix environment to determine if a file is
> being accessed (written to) by another process? If that is possible, then
> I'd want to have my process 'skip' the 'capturing' of the file and try
> again during the next interval.
>
> Regards
> Paul Christidis
>
> * To join/leave the list, search archives, change list settings, *
> * etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|