fgets() for open() ??

andrew.m.shaw ams at cbnewsl.ATT.COM
Fri Sep 1 00:23:01 AEST 1989


>From article <410002 at hpdml93.HP.COM>, by libbyb at hpdml93.HP.COM (Libby Bagley):
< If I open a file using fopen(), I have the function
< fgets() available to me.
< 
< If I open a file using open(), is there a function
< similar to fgets() that I can use?  (Remember my
< reference into the file is no longer a file
< pointer, but an integer file descriptor.)

FILE * fdopen (int fd, char * type) associates a stdio
stream with the fd returned by open(2).  This allows
you to use fgets,fseek, etc.  See fopen(3).

	Andrew Shaw



More information about the Comp.lang.c mailing list