in reply to Is file still open ?

As others have mentioned, there's unfortunately not a straightforward and portable way to find out if a file is still open. Here are some pragmatic possibilities (in other words, some hacks).