Join GitHub today
GitHub is home to over 28 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 126.96.36.199 (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?