The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 09-28-2001
rwb1959's Avatar
rwb1959 rwb1959 is offline
Registered User
  
 

Join Date: Aug 2001
Location: Virginia, USA
Posts: 438
I'm not exactly clear what
you are trying to do but
after your done reading the file,
try closing all fd's

// assuming you have no more that 10 files open
for(i = 0; i < 10; i++)
{
if(close(i) < 0)
break;
}

...then open a new file. The fd will be 0 (stdin).