<HTML><BODY STYLE="font:10pt verdana; border:none;"><DIV>Another idea: Create a symlink to another directory when the ftp has completed, removing it afterwards.</DIV> <DIV>&nbsp;</DIV> <BLOCKQUOTE style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"> <DIV style="FONT: 10pt Arial">----- Original Message -----</DIV> <DIV style="BACKGROUND: #e4e4e4; FONT: 10pt Arial; COLOR: black"><B>From:</B> Dave Anselmi</DIV> <DIV style="FONT: 10pt Arial"><B>Sent:</B> Wednesday, January 09, 2002 1:48 PM</DIV> <DIV style="FONT: 10pt Arial"><B>To:</B> clue-tech@clue.denver.co.us</DIV> <DIV style="FONT: 10pt Arial"><B>Subject:</B> Re: [CLUE-Tech] Partial file troubles</DIV> <DIV>&nbsp;</DIV>Grant Johnson wrote:<BR><BR>[...]<BR><BR>&gt; Here is the problem:<BR>&gt; The file is marked as modified, or comes into existence before the FTP<BR>&gt; is complete.&nbsp; PGP does not like this.&nbsp; Is there a test for the number of<BR>&gt; open file handles on that inode, or a way to tell if exclusive access is<BR>&gt; available to a file so that we can tell from the shell script when FTP<BR>&gt; is done before we start the PGP?<BR><BR>lsof may be what you need.&nbsp; See lsof(8).<BR><BR>Perhaps you could also change your scripts so the trigger condition is<BR>atomic.&nbsp; For example, you could ftp the file to a temporary name and then<BR>rename it.&nbsp; Renaming is atomic while the transfer is not.<BR><BR>I don't know if your ftp supports renaming remote files, so here are some<BR>other ideas:<BR><BR>Use a directory as the trigger since ftp does have a mkdir.<BR><BR>Ftp a lock file over.&nbsp; While the lock file exists, the script won't run even<BR>though the data file has been modified.&nbsp; After the data file ftp is<BR>complete, remove the lock file.&nbsp; Since this is more complicated, perhaps it<BR>is more subject to breakage.&nbsp; On the other hand, you'll know that the ftp<BR>didn't end prematurely.&nbsp; Depends what you need.<BR><BR>Dave<BR><BR><BR>_______________________________________________<BR>CLUE-Tech mailing list<BR>CLUE-Tech@clue.denver.co.us<BR>http://clue.denver.co.us/mailman/listinfo/clue-tech<BR></BLOCKQUOTE></BODY></HTML>