• Post Reply Bookmark Topic Watch Topic
  • New Topic

wrong file size and last-modified date for very large files  RSS feed

 
stephen eaton
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using the java.io.File class, with jdk 1.4.1, to retrieve and display attributes of files on AIX.

For files that are very large -- starting at around 2G -- java appears to think those files do not exist. I can create a File object with the file's name, but the length() returns 0 and lastModified = Jan 1 1970 -- both defaults for files that do not exist.



Any advice ior experience is appreciated!
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java is subject to the limitations of the native file system. I know for a fact that AIX used to have a 2GB file limit because it used a signed integer for file size (NOTE: this is going back 10 years). Some utilities may still have this limitation.
I checked the platforms I have handy and Java can write and get the attributes of 2GB+ files on Windows 2000 and Linux (kernel 2.6.12, ReiserFS 3.6). You should check the extent of large file support in your version of AIX.
 
stephen eaton
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. This appears to be a problem with the IBM jdk 1.4.2 (I misspoke above, not 1.4.1) rather than the native file system, which appears to handle the large files just fine. Now I am trying to find out if the jdk has a fix.
 
stephen eaton
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have since found out that this is a bug in the IBM 1.4.2 jdk for AIX, & has been fixed in the currently available patch.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!