reading binary data in C
Charles Krasic
krasic at tucana.mpr.ca
Sat May 25 07:56:34 AEST 1991
I'm writing a program which needs to read a chunk of data
directly into memory and I'm having trouble deciding what is the
_best_ way to do it. I've been considering three possibilities:
1) mmap the chunk of the file into memory with
flags set to MAP_PRIVATE
2) malloc a chunk of memory and use either
i) fread
or ii) fgetc
Any of these should work (I think...) but I would like to know
which is best.
--
Charles Krasic | Voice : (604) 294-1471
MPR Teltech Ltd. | Fax : (604) 293-5787
8999 Nelson Way, Burnaby, BC | E-Mail: krasic at mprgate.mpr.ca
Canada, V5A 4B5 | mprgate.mpr.ca!krasic at uunet.uu.net
More information about the Comp.unix.programmer
mailing list