The UNIX and Linux Forums
>
Top Forums
>
High Level Programming
Changing stdin from file redirection to console input
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
Changing stdin from file redirection to console input
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
2
(
permalink
)
09-28-2001
rwb1959
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).
rwb1959
View Public Profile
Visit rwb1959's homepage!
Find all posts by rwb1959
Find rwb1959's past nominations received
Find rwb1959's present nominations given