O'Reilly logo

Advanced Mac OS X Programming: The Big Nerd Ranch Guide by Mark Dalrymple

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Misc Functions

Here are some miscellaneous buffered I/O functions.

int fileno (FILE *stream);

This returns the file descriptor that the stream is wrapped around. This is handy if you need to use fcntl(), fchmod(), fstat(), or the dup() functions.

int getw (FILE *stream);

int putw (int w, FILE *stream);

These are like getc()/putc() but read or write an integer. The integers are not written in a canonical form (discussed in Chapter 14: Network Programming With Sockets), so if you want to be portable, you will need to put the bytes into a known byte order.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required