Sometime during Kestrel we broke support for large files in the
RandomAccessFile class.
import java.io.*;
public class Big {
public static void main(String[] args) throws Exception {
File f = new File("big");
f.delete();
RandomAccessFile raf = new RandomAccessFile(f, "rw");
raf.seek((long)Integer.MAX_VALUE * 2);
raf.write('x');
long l = raf.length();
System.out.println((l == 0) ? "FAIL" : ("OK: " + l));
raf.close();
f.delete();
}
}
This only fails with the classic/native) and HotSpot; it works fine with
classic/green, and fine in 1.2.0 and 1.2.2:
% /local/jdk/1.2.0/bin/java -green Big
OK: 4294967295
% /local/jdk/1.2.0/bin/java -native Big
OK: 4294967295
% /local/jdk/1.2.2/bin/java -green Big
OK: 4294967295
% /local/jdk/1.2.2/bin/java -native Big
OK: 4294967295
% /local/jdk/1.3beta/bin/java -green Big
OK: 4294967295
% /local/jdk/1.3beta/bin/java -native Big
Exception in thread "main" java.io.IOException: Value too large for defined data type
at java.io.RandomAccessFile.seek(Native Method)
at Big.main(Big.java:11)
% /local/jdk/1.3/bin/java -hotspot Big
Exception in thread "main" java.io.IOException: Value too large for defined data type
at java.io.RandomAccessFile.seek(Native Method)
at Big.main(Big.java:11)
%
This regression should be fixed for Kestrel FCS.
It was discovered while evaluating a fix for 4288670.
-- mr@eng 1999/11/10
RandomAccessFile class.
import java.io.*;
public class Big {
public static void main(String[] args) throws Exception {
File f = new File("big");
f.delete();
RandomAccessFile raf = new RandomAccessFile(f, "rw");
raf.seek((long)Integer.MAX_VALUE * 2);
raf.write('x');
long l = raf.length();
System.out.println((l == 0) ? "FAIL" : ("OK: " + l));
raf.close();
f.delete();
}
}
This only fails with the classic/native) and HotSpot; it works fine with
classic/green, and fine in 1.2.0 and 1.2.2:
% /local/jdk/1.2.0/bin/java -green Big
OK: 4294967295
% /local/jdk/1.2.0/bin/java -native Big
OK: 4294967295
% /local/jdk/1.2.2/bin/java -green Big
OK: 4294967295
% /local/jdk/1.2.2/bin/java -native Big
OK: 4294967295
% /local/jdk/1.3beta/bin/java -green Big
OK: 4294967295
% /local/jdk/1.3beta/bin/java -native Big
Exception in thread "main" java.io.IOException: Value too large for defined data type
at java.io.RandomAccessFile.seek(Native Method)
at Big.main(Big.java:11)
% /local/jdk/1.3/bin/java -hotspot Big
Exception in thread "main" java.io.IOException: Value too large for defined data type
at java.io.RandomAccessFile.seek(Native Method)
at Big.main(Big.java:11)
%
This regression should be fixed for Kestrel FCS.
It was discovered while evaluating a fix for 4288670.
-- mr@eng 1999/11/10
- relates to
-
JDK-4203706 java.io.File.length does not work on large files (solaris)
-
- Resolved
-
-
JDK-4288670 java.io.File attribute accessors broken on large files
-
- Resolved
-