Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Large File Support

Reply
Thread Tools

Large File Support

 
 
Chris Bentz
Guest
Posts: n/a
 
      09-13-2003
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.


 
Reply With Quote
 
 
 
 
Marco Schmidt
Guest
Posts: n/a
 
      09-13-2003
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
 
Reply With Quote
 
 
 
 
Chris Bentz
Guest
Posts: n/a
 
      09-13-2003
Oh. Ok - then I have no problems. Thanks.

Chris.

"Marco Schmidt" <> wrote in message
news:...
> 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



 
Reply With Quote
 
=?ISO-8859-1?Q?Daniel_Sj=F6blom?=
Guest
Posts: n/a
 
      09-13-2003
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

 
Reply With Quote
 
Tor Iver Wilhelmsen
Guest
Posts: n/a
 
      09-13-2003
"Chris Bentz" <> 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.
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      09-13-2003
On Sat, 13 Sep 2003 16:32:07 -0400, "Chris Bentz" <>
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.
 
Reply With Quote
 
Brad BARCLAY
Guest
Posts: n/a
 
      09-14-2003
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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
median of large data set (from large file) friend.05@gmail.com Perl Misc 5 04-02-2009 04:06 AM
large file support Joseph C++ 7 12-03-2004 10:24 AM
Large File Download support Nik Schlein Computer Support 2 11-14-2004 02:48 PM
RE: looking for 2.1.3 Windows binary with large file support Tim Peters Python 2 11-25-2003 09:53 PM
looking for 2.1.3 Windows binary with large file support Mathew Python 0 11-25-2003 07:03 PM



Advertisments