Its ok, I found out the File::Tail>-new() has an "Ignore_whenempty" or something like that...I forget what its called now, and this solves my problem...phew.
Jeremy
-------- Original Message --------
Subject: [DUG-Offtopic] Some PERL help
From: [email protected]
Date: Tue, June 29, 2010 12:38 pm
To: [email protected]
Hi Guys.I have a PERL script that runs on a linux box. I didnt write it, but I have made changes here and there and sort of understand it. I know what it does etc.It runs as a daemon and it looks for a file and uses Tail to get the last line of data.However, if the file doesnt exist, it stops running. I have added some code to check the file exists, but all this does is stops it exiting with an error :-)the think that went thru my mind is, the file that it looks at is being removed by a service that I cant find and the user knows thingking about it. So my idea is to create an empty file when the filed doesnt exist so that atleast the server will keep running.I am a little out of my depth, and just wondered, if I posted the code if someone could 1. point me in the right direct, or 2.tell me what I need to do.I did try creating the file based on some code of the net, but it didint really seem to work.Thanks, Jeremy
_______________________________________________
NZ Borland Developers Group Offtopic mailing list
Post: [email protected]
Admin: http://delphi.org.nz/mailman/listinfo/offtopic
Unsubscribe: send an email to [email protected] with Subject: unsubscribe
_______________________________________________ NZ Borland Developers Group Offtopic mailing list Post: [email protected] Admin: http://delphi.org.nz/mailman/listinfo/offtopic Unsubscribe: send an email to [email protected] with Subject: unsubscribe
