ruby....

if FileTest.exist? file_name
  do_stuff
end

On Wed, 9 Aug 2006, Phill Coxon wrote:
As to why it's disappearing...no idea.  I'm starting to suspect it may
be malicious code that a previous programmer installed to delete the
config file so he would pick up the "maintenance" work.  I've had a good
look around but haven't found anything yet.

Sounds like something like the ecosconfig tool does.

It sanity checks the config file and rewrites it.

So every time you run the tool, it rewrites the file (watch the mtime timestamp)

The gotcha of course is if the tool dies between reading and rewriting,
the file goes away...

If you can remove the write permissions on the directory.

Other nifty things would be..

  fuser -v /path/to/file
  lsof

Inotify on the directory would be good.

All this reminds me of a war story my brother told me...

He was sysadmin for a large powerstation.

The system kept curling up and dying in the middle of the night...

Very Bad Plan.

On closer inspection he found someone had installed an "idle process killer".

And the most idle, least good, laziest waste of resource was...

Process pid 1, "init"





Are you sure someone isn't cleaning up temporary files or something.

Anyhoo, do tell us what it was when you find out.


John Carter                             Phone : (64)(3) 358 6639
Tait Electronics                        Fax   : (64)(3) 359 4632
PO Box 1645 Christchurch                Email : [EMAIL PROTECTED]
New Zealand

Carter's Clarification of Murphy's Law.

"Things only ever go right so that they may go more spectacularly wrong later."

From this principle, all of life and physics may be deduced.

Reply via email to