Its a while since I did unix scripts, but one thing to check is how the file existing is being tested - I recall something along the lines of the unix utility test -f (which tests if a file exists). If thats whats being used check documentation how it behaves when the file exists and has a size vs if it exists with a size of zero bytes. I recall that can be an issue. Zero byte files cause unexpected issues on lots of platforms... also the alternate flavours of the test which can tell if the file is readable, writable, has a size, type of file etc (all of which are options of the test)
eg see http://linux.about.com/library/cmd/blcmdl1_test.htm John 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
