delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/04/28/17:22:42

Date: Fri, 28 Apr 2000 18:07:41 -0400 (EDT)
Message-Id: <200004282207.SAA26925@indy.delorie.com>
From: Eli Zaretskii <eliz AT delorie DOT com>
To: hank_heng <hank_heng AT hotmail DOT com>
CC: djgpp AT delorie DOT com
In-reply-to: <8ebgps$5qd$1@nnrp1.deja.com> (message from hank_heng on Fri, 28
Apr 2000 08:06:26 GMT)
Subject: Re: File Pointer.
References: <8ebgps$5qd$1 AT nnrp1 DOT deja DOT com>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: hank_heng <hank_heng AT hotmail DOT com>
> Newsgroups: comp.os.msdos.djgpp
> Date: Fri, 28 Apr 2000 08:06:26 GMT
> 
>   If I have a File Pointer, how do I know I that file pointer is still
> pointing to a stream or it is already close ?

In general, you can't.

You can try something like the snippet below, but it's not 100%
reliable and not 100% portable (it is also UNTESTED):

	FILE *fp;
	...
	int still_open = lseek(filen(fp), 0L, SEEK_CUR) != -1;

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019