READ versus FREAD and WRITE versus FWRITE ...

Thomas M. Breuel tmb at talcott.UUCP
Sat Mar 9 16:12:18 AEST 1985


> 	I would be interested to know in which cases 
> 		read/write(fildes, buffer, nbytes)'s
> 	are more time efficient than 
> 		fread/fwrite(ptr, sizeof(*ptr), nitems, stream)'s .

If you read large (> blocksize) items from a file, then read/write
is faster. This is because fread/fwrite use read/write to read
blocks from a file.

Personally, I prefer using stdio for terminal I/O and read/write for
binary file I/O.

						Thomas.



More information about the Comp.lang.c mailing list