in reply to Re: How do I tell if a handle is open for writing?
in thread How do I tell if a handle is open for writing?

Excellent! I had thought about just trying to write something to the file but didn't want to modify the file. It didn't occur to me to write *nothing* to the file :)

I was worried that even this solution might have unintended side effects, e.g., changing the modified time on the file or (less likely in my mind) writing a null character to the file. I tried it on my WinXP system and it doesn't appear to modify the file in any way -- modified date remains unchanged.

Thanks!

--DrWhy

"If God had meant for us to think for ourselves he would have given us brains. Oh, wait..."

  • Comment on Re^2: How do I tell if a handle is open for writing?

Replies are listed 'Best First'.
Re^3: How do I tell if a handle is open for writing?
by Anonymous Monk on Mar 01, 2006 at 17:02 UTC
    It should write an EOF at the position (on Win that is, or was it FAT-filesystem only?) and everything after it would be lost. Of course perl could intervene and take it to mean a check for writability, and then use other means to check and get you the result. But I would first seek to EOF.