For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > March 2006 > File checking









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author File checking
Lakeuk

2006-03-27, 6:57 pm

I have an external application that generates an excel file on a remote
server and then is supposed to delete a trigger file to confirm that it
has completed.

I'm writing a perl script that needs to ftp to the remote server to
check if the trigger file exists, if it doesn't exist then it get's the
excel file from the remote server. Problem is that when the trigger
has been deleted the excel file can still be generated by the external
application (the external app deletes the trigger too early), to get
round this I'm planning to add 5 minute wait before attempting the get
the excel file from the remote server.

But is there anything else I can write in perl to check whether the
external server (unix) has finished writing the excel, I've checked the
file checking options (http://www.pageresource.com/cgirec/ptut17.htm)
but I don't think they'll help in my case.

Dave

usenet@DavidFilmer.com

2006-03-27, 6:57 pm

Lakeuk wrote:
> But is there anything else I can write in perl to check whether the
> external server (unix) has finished writing the excel


Does the other server/application implement file locking? If so, your
Perl script simply checks for a filelock, and sleeps for a few seconds
if the lock is present. You ought to code exception handling to prevent
infinite loops, etc.

--
http://DavidFilmer.com

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com