Menu ▾ ▴

Seek limited to 32 bits?

Help
Skyfaller
2005-05-31
2012-10-08
  • Skyfaller

    Skyfaller - 2005-05-31

    Hello!

    I am writing an imaging solution for linux. I have taken a look at seek (unit System), fdseek (unit oldLinux), and fpLSeek (BaseUnix). All of these functions only take LongInt 32-bit offsets, restricting file size to 4GB. Linux supports 64 bit offsets if the compiler flag __USE_LARGEFILE64 is set (see http://freshmeat.net/articles/view/709/). Is a similar flag
    supported in FreePascal?

    Kind Regards
    Bjrn Ganster

     
    • Marco van de Voort

      No. FPC fs support is still 32-bit by default,. there are plans to change this in the next version.

      However you can call any function you like (including kernel syscalls and libc) by simply defining the call prototype. (I think for linux, a 64-bit fs call is predefined in unit libc)

      These are then based on OS handles, not on language filetypes (file and text. eq to FILE in C), however "getfilehandle" allows you to get the filehandle out of a native type (compare fileno)

       

Log in to post a comment.