![]() |
Large File Support
Anyone have any pointers on Large File Support (i.e. > 2 GB).
java.io.File.Length() is a long, 32bit, and will not return the size properly. Thanks in Advance, Chris. |
Re: Large File Support
Chris Bentz:
>Anyone have any pointers on Large File Support (i.e. > 2 GB). > >java.io.File.Length() is a long, 32bit, and will not return the size >properly. length() returns a long, but that is always 64 bits large in Java. If it really does not return a correct size for large files you have probably found a bug. Regards, Marco -- Please reply in the newsgroup, not by email! Java programming tips: http://jiu.sourceforge.net/javatips.html Other Java pages: http://www.geocities.com/marcoschmidt.geo/java.html |
Re: Large File Support
Oh. Ok - then I have no problems. Thanks.
Chris. "Marco Schmidt" <marcoschmidt@geocities.com> wrote in message news:dg27mvs9hntut1ofbhgsda4773ssd3i2ro@4ax.com... > Chris Bentz: > > >Anyone have any pointers on Large File Support (i.e. > 2 GB). > > > >java.io.File.Length() is a long, 32bit, and will not return the size > >properly. > > length() returns a long, but that is always 64 bits large in Java. > > If it really does not return a correct size for large files you have > probably found a bug. > > Regards, > Marco > -- > Please reply in the newsgroup, not by email! > Java programming tips: http://jiu.sourceforge.net/javatips.html > Other Java pages: http://www.geocities.com/marcoschmidt.geo/java.html |
Re: Large File Support
Chris Bentz wrote:
> Anyone have any pointers on Large File Support (i.e. > 2 GB). > > java.io.File.Length() is a long, 32bit, and will not return the size > properly. > > Thanks in Advance, > Chris. Long is 64 bits. Are you sure your filesystem can handle files larger than 2 Gb? -- Daniel Sjöblom |
Re: Large File Support
"Chris Bentz" <cbentz@tbaytel.net> writes:
> Oh. Ok - then I have no problems. Thanks. Also if you can use java.nio.* (JRE 1.4.x and later), look at java.nio.channels.FileChannel and related classes. |
Re: Large File Support
On Sat, 13 Sep 2003 16:32:07 -0400, "Chris Bentz" <cbentz@tbaytel.net>
wrote or quoted : >java.io.File.Length() is a long, 32bit, and will not return the size >properly. a long is 64 bits. That ought to handle any file I've ever heard of. see http://mindprod.com/jgloss/primitive.html -- Canadian Mind Products, Roedy Green. Coaching, problem solving, economical contract programming. See http://mindprod.com/jgloss/jgloss.html for The Java Glossary. |
Re: Large File Support
Chris Bentz wrote:
> Anyone have any pointers on Large File Support (i.e. > 2 GB). > > java.io.File.Length() is a long, 32bit, and will not return the size > properly. A long in Java is 64 bits, but the problem is a lot more complicated than that. There are a few issues that need to be addressed within the JRE to properly handle such large files: 1) Does the underlying filesystem support files this large? Many less recent filesystems don't. 2) Is the JRE using the correct OS APIs to handle large files? As the concept of filesystems being able to handle such large files is fairly recent, many of the core APIs are build around 32 bit integer values. In order to retain backward compatibility, many OS's, instead of changing the existing API calls that are using 32 bit ints, added new calls that support 64 bit ints. If the JRE is still using the original API, and not the newer 64-bit capable calls, then even if you have a 64-bit enabled filesystem you're still not going to be able to handle large files. HTH! Brad BARCLAY -- =-=-=-=-=-=-=-=-= From the OS/2 WARP v4.5 Desktop of Brad BARCLAY. The jSyncManager Project: http://www.jsyncmanager.org |
| All times are GMT. The time now is 03:36 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.