File#fsync, File#flock_exclusive, File#flock_shared, and File#flock_unlock belong in IO::FileDescriptor #9793
Labels
good first issue
This is an issue suited for newcomers to become aquianted with working on the codebase.
help wanted
This issue is generally accepted and needs someone to pick it up
Unix-style file operations, like
File#fsync
,File#flock_exclusive
,File#flock_shared
, andFile#flock_unlock
belong inIO::FileDescriptor
. On Windows these are completely different APIs, which perhaps is why they are presently inFile
. However, this is a significant handicap on Unix-like systems and makes the user want to import the API fromLibC
, which would be ugly and even less portable.An example of how to code these APIs portably to Windows is at https://github.com/WoLpH/portalocker
Why is the user using
IO::FileDescriptor
? They are doing operations onSTDIN
,STDOUT
, orSTDERR
(which can be legitimate files), or on a file descriptor inherited from the parent process, or passed in from a foreign library.The text was updated successfully, but these errors were encountered: