r/C_Programming • u/Just_Government3790 • Sep 12 '26
Question What C function would you delete and rewrite first, and why?
For me it's fnmatch - mostly because it's 40 year's old and smell's funny.
96
Upvotes
View all comments
Show parent comment
1
u/Dangerous_Region1682 Sep 14 '26
Oh how I hate FILE I/O. I know open/close/read/write/sleek etc are system calls and hence not considered portable to non UNIX like systems they are not hard to provide as a library capability for those systems. You aren’t going to be able to use the level of ioctl() that is needed for terminal I/O with FILE library functions anyway, so you do really need file descriptor based library calls for that case anyways, on none UNIX derived systems. Yes, I know you can perhaps express terminal I/O devices using the file system in some iterations, but many UNIX and non UNIX derived systems alike don’t have that kind of file system abstraction. Anyway, I just don’t like it.