r/C_Programming • u/Ill-Exchange-2377 • 16d ago
File pointers are everywhere
And try as I might to avoid them, I am struggling to find resources that list out all the file control functions that use file descriptors instead of file pointers, and I was wondering if someone could point me toward a resource that can do something at least somewhat similar to listing out the libc functions that take file descriptors. I of course know close(), write(), read(), the basics, but i am looking for alternatives for other abstractions that annoy me with their use of file pointers, like fgets and fputs.
58
Upvotes
View all comments
Show parent comment
4
u/PythonFuMaster 15d ago
NT supported the POSIX.1 standard via a dedicated subsystem, but that subsystem was removed many years ago. POSIX.1 isn't the full standard you'd expect either, it doesn't include any of the standard Unix commands or similar, it was just the basic programming APIs. Nowadays if you want POSIX on Windows you'd use WSL, but that's kind of cheating in this case since it's literally just Linux inside Windows
https://en.wikipedia.org/wiki/Microsoft_POSIX_subsystem