fadedbee
fadedbee

Reputation: 44737

How can you portably (x86 and AMD64) seek to a (>4GB) offset in a file?

How can you portably (x86 and AMD64) seek to a (>4GB) offset in a file?

File.seek() accepts a long on AMD64 and an int on x86 (or a size_t on both).

I need it to accept a long on x86. How can I do this?

(I have horrible feeling that this is a limitation of seek in C, and that I'll have to do multiple relative seeks to get to a >4GB offset.)

Thanks,

Chris.

Upvotes: 6

Views: 203

Answers (1)

Vladimir Panteleev
Vladimir Panteleev

Reputation: 25187

std.stdio.File.seek takes a long but converts it to an int on Windows. That would be a limitation of Digital Mars' C runtime library. Judging by the source code, there are no other platform limitations.

Upvotes: 4

Related Questions