delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/04/28/15:18:20

From: dontmailme AT iname DOT com (Steamer)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: File Pointer.
Date: Fri, 28 Apr 2000 19:58:25 GMT
Organization: always disorganized
Lines: 15
Message-ID: <3909ed55.42962091@news.freeserve.net>
References: <8ebgps$5qd$1 AT nnrp1 DOT deja DOT com>
NNTP-Posting-Host: modem-58.golden-cleaner.dialup.pol.co.uk
X-Trace: news5.svr.pol.co.uk 956951906 2554 62.137.19.58 (28 Apr 2000 19:58:26 GMT)
NNTP-Posting-Date: 28 Apr 2000 19:58:26 GMT
X-Complaints-To: abuse AT theplanet DOT net
X-Newsreader: Forte Free Agent 1.11/32.235
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

hank_heng wrote:

>  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 ?

I don't think you can if you don't keep track of it.  If it's difficult
to keep track of this in your program then perhaps you could set the
pointer equal to NULL every time you close a file:

    fclose(fp);
    fp=NULL;

That way you can easily check whether or not the pointer is still valid.

S.

- Raw text -


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