From: eplmst AT lu DOT erisoft DOT se (Martin Stromberg) Newsgroups: comp.os.msdos.djgpp Subject: Re: zero file descriptors Date: 12 Oct 2000 15:57:20 GMT Organization: Ericsson Erisoft AB, Sweden Lines: 18 Message-ID: <8s4n10$d55$1@antares.lu.erisoft.se> References: NNTP-Posting-Host: lws256.lu.erisoft.se X-Newsreader: TIN [version 1.2 PL2] To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Jeffrey_Krupp AT May-Co DOT com wrote: : I am having a problem with fopen where it opens a file (returns a valid : file pointer), but then its file handle is zero. When this happens, I can't : fseek,fread,or fwrite. The same is true for a socket() call. No wonder as this is what fopen() returns when the call fails (NULL)! : As a work-around after the original fopen, I have been re-opening the same : file, getting an actual valid handle/pointer, then closing the original : pointer(the one with the zero handle). If those two fopen() calls are identical it'd be very strange. Show us some (complete compilable) code please. Right, MartinS