[LCP]How to tell if a file is open?

Madhav M. madhav3333 at lycos.com
Fri Aug 31 16:06:25 UTC 2001


 Using fcntl(), information such as file descriptor is open or not, can be obtained.

error number EBADF indictes whether its an open file descriptor or not.

--

On Thu, 30 Aug 2001 10:35:11  
 David Filion wrote:
>
>
>
>I'm writing a routine that need to check if the stream it is writing to is open
>before it writes to it.  for example,  before I try to write and error messge to
>stdout, I want to make sure it is still open.  How can I do this?  (I remember
>reading how to somewhere but I can't remember where.)
>
>Thanx.
>
>
>_______________________________________________
>This is the Linux C Programming List
>:  http://lists.linux.org.au/listinfo/linuxcprogramming List
>


Get 250 color business cards for FREE!
http://businesscards.lycos.com/vp/fastpath/



More information about the linuxCprogramming mailing list