Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
File#pos fails for files greater than java.lang.Integer::MAX_VALUE on 64-bit systems #3664
When writing files greater than 2GiB, the Tempfile#pos value throws an error.
require 'tempfile' halfG = "12345" * 100_000_000 tmp = Tempfile.new("demo") 9.times do puts tmp.write(halfG) begin puts tmp.pos # will error once > 2GiB rescue puts "Error, can still write" puts tmp.write(halfG) puts tmp.size # works fine puts tmp.pos # will error end end
JRuby 220.127.116.11 (2G heap):
Digging in, this looks to be a jnr-posix issue as all the declarations are ints, not longs. Should I cross-post this issue in jnr?