2 ms·
What you write about I/O is interesting to me, because I am generally of the belief that any decent library in C should have a way to replace I/O with an altern
by asveikau 8y ago
What you write about I/O is interesting to me, because I am generally of the belief that any decent library in C should have a way to replace I/O with an alternate mechanism via a couple of function pointers.
Even if you stick to recent platforms, depending totally on FILE* can be a mistake. For example Windows has all its idiosyncrasies with sharing modes and whatnot, not all of them captured by fopen. Or you may wish to implement streaming or some alternate data source not on the filesystem. The author of a library can't predict these things, so should allow the caller to bring their own.
- gpderetta 8y agoOne issue is that FILE can't be extended in standard C, although there non portable extensions (like fopencookie).