[jcifs] Re: SmbFile CopyTo size limit

Michael B Allen miallen at ioplex.com
Wed Mar 12 03:30:49 GMT 2008


On Wed, 12 Mar 2008 02:43:24 +0000 (UTC)
Steve K <skuekes at rxhealthcare.org> wrote:

> Michael B Allen <miallen <at> ioplex.com> writes:
> 
> > 
> > On Tue, 11 Mar 2008 20:03:43 +0000 (UTC)
> > Steve K <skuekes <at> rxhealthcare.org> wrote:
> > 
> > > I am using jcifs 1.2.18 to copy files between 2 smb servers using the 
> > > SmbFile and its copyTo method.  The files I'm copying are larger than 
> 4.45 Gb.
> > > The results are that I only get an output file that is 2,147,493,180 and 
> the 
> > > copy completes without any exceptions.
> > > 
> > > If I re-implement the copy using the inputstream and the outputstream for 
> > > the two smbfiles and do my own reading and writing it copies these large 
> > > files just fine.  It looks like there is some kind of 2 Gb limit in 
> > > the SmbFile.copyTo method.
> > > 
> > > Is this a limit/bug or do I need to do something else to make copyTo 
> > > work properly.
> > 
> > Last I checked there was no limit in JCIFS. However, it is not uncomon
> > to run into limits either on the source CIFS server or receiving CIFS
> > server. What are the servers?
> > 
> > Mike
> > 
> The copy process is running on Linux and the from and to systems are
> Windows 2000 Server systems.  The copy operation works if I open up the 
> InputStream from the from file and read it in, then write it to the 
> OutputStream
> for the to file, so It doesn't look like there's a limit on Windows.

Mmm, just glancing at the code it doesn't look like it could work. I
thought it did.

In SmbFile there's an inner class called WriterThread. All instances of
'n' and 'off' need to be long and not int. If you're brave you could
try making the necessary changes. Note that you'll also need to change
the type of 'off' to long wherever it's passed to w.write(...).

Otherwise I'll put this on the TODO list.

Mike

-- 
Michael B Allen
PHP Active Directory SPNEGO SSO
http://www.ioplex.com/


More information about the jcifs mailing list