However, I don't think that the main point of the low-level FileReader::readDirect implementation for Windows is skipping of the OS buffers (couldn't you use the regular File class with FILE_FLAG_NO_BUFFERING instead?) but the use of OVERLAPPED (async I/O). The closest equivalent for that on Linux would probably be AIO (https://man7.org/linux/man-pages/man7/aio.7.html).
So possibly the FileReader methods should rather be called readAsync (overlapped/AIO) and readUnbuffered (FILE_FLAG_NO_BUFFERING/O_DIRECT/F_NOCACHE). Is buffered reading even needed there? When would that work if the unbuffered read fails?
FileReader: :readDirect implementation with O_DIRECT/F_NOCACHE: https:/ /github. com/airdcpp/ airdcpp- windows/ commit/ eb1e075d5a69862 c4f2255f9ea2f20 4bb70921ba
However, I don't think that the main point of the low-level FileReader: :readDirect implementation for Windows is skipping of the OS buffers (couldn't you use the regular File class with FILE_FLAG_ NO_BUFFERING instead?) but the use of OVERLAPPED (async I/O). The closest equivalent for that on Linux would probably be AIO (https:/ /man7.org/ linux/man- pages/man7/ aio.7.html).
So possibly the FileReader methods should rather be called readAsync (overlapped/AIO) and readUnbuffered (FILE_FLAG_ NO_BUFFERING/ O_DIRECT/ F_NOCACHE) . Is buffered reading even needed there? When would that work if the unbuffered read fails?