News for hackers. Stuff that matters.
Re:Working with Files Is Hard (2019) by yahayahya on Thursday January 23, 2025 @01:15PM (#42806409)
Is that because the windows APIs are better? Or because businesses build their embedded systems/servers with Windows?
Re:Working with Files Is Hard (2019) by wruza on Thursday January 23, 2025 @04:03PM (#42808042)
I doubt that, was just curious how it might compare in the article.
Re:Working with Files Is Hard (2019) by p_ing on Thursday January 23, 2025 @05:14PM (#42808602)
Certainly depends on which APIs you ultimately use as a developer, right? If it is .NET, they're super simple, and you can get IOCP for "free" and non-blocking async I/O is quite easy to implement.

I can't say the Win32 File API is "pretty", but it's also an abstraction, like the .NET File Class is. And if you touch the NT API, you're naughty.

On Linux and macOS you use the same API, just the backends are different if you want async (epoll [blocking async] on Linux, kqueue on macOS).

Re:Working with Files Is Hard (2019) by pjc50 on Friday January 24, 2025 @05:08AM (#42811853)
The windows APIs are certainly slower. Apart from IOCP I don't think they're that much different? Oh, and mandatory locking on executable images which are loaded, which has .. advantages and disadvantages (it's why Windows keeps demanding restarts)