Thread: Need some suggestions for cross platform code

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Banned
    Join Date
    Oct 2022
    Posts
    5
    One potential solution is to use the pread and pwrite system calls, which provide the same functionality as read and write, but allow for a file offset to be specified as a parameter. This way, you can avoid all the complexities associated with synchronizing file offsets, and it should be more efficient as well.

  2. #2
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    1,735
    Quote Originally Posted by Vithika View Post
    One potential solution is to use the pread and pwrite system calls, which provide the same functionality as read and write, but allow for a file offset to be specified as a parameter. This way, you can avoid all the complexities associated with synchronizing file offsets, and it should be more efficient as well.
    Thank you, I'll look into that as soon as I report a bug in mingw, they hid the FileSetPointer & FileSetPointerEx behind this:
    Code:
    #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || _WIN32_WINNT >= _WIN32_WINNT_WIN10
    The 1st condition is fine but the 2nd is flat out wrong, that function was available way earlier than Windows 10 and I've not been able to compile as a result of it

  3. #3
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    1,735
    Quote Originally Posted by awsdert View Post
    Thank you, I'll look into that as soon as I report a bug in mingw, they hid the FileSetPointer & FileSetPointerEx behind this:
    Code:
    #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || _WIN32_WINNT >= _WIN32_WINNT_WIN10
    The 1st condition is fine but the 2nd is flat out wrong, that function was available way earlier than Windows 10 and I've not been able to compile as a result of it
    I'm a dumbass, I remembered the function names wrong, was supposed to use SetFilePointer instead of FileSetPointer,

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 01-09-2016, 04:21 PM
  2. Replies: 2
    Last Post: 03-30-2013, 02:50 AM
  3. Looking for info: Cross-Platform
    By AvidGamer in forum C++ Programming
    Replies: 7
    Last Post: 09-13-2010, 10:19 AM
  4. Cross-Platform GUI
    By @nthony in forum C++ Programming
    Replies: 4
    Last Post: 10-24-2007, 02:51 PM
  5. Cross-platform code...
    By Sul in forum C++ Programming
    Replies: 10
    Last Post: 06-18-2004, 04:44 PM

Tags for this Thread