Alex Rivera | Logout

"fprintf"-like function for file descriptors (i.e. int fd instead of FILE* fp)

Asked 2010-11-22T14:43:44.137
23

Maybe I'm just missing it, but isn't there a function equivalent to fprintf for file descriptors, or even a way to temporarily flip-flop between them?

Edit
Report

1 Answer

1

No, there isn't as standard, but the two do different things. fprinft, as part of stdio, does things like buffer reads and writes, supports ungetc etc. Using a fd bypasses all that and calls the OS directly.

So they're not interchangeable. Flip flopping between them would screw up stdio buffering if nothing else

answered 2010-11-22T14:47:09.140

Your Answer