You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Eric Hamacher <er...@enetrix.com> on 2008/06/30 21:15:16 UTC
Commons IO FileUtils question
Hello:
I took a file on my filesystem, copied and renamed it. I took the two
files and compared them using FileUtils.contentEquals(File, File). In
this case, shouldn't the method return true? If not, when would it
return true?
Thanks
Regards,
Eric Hamacher
******************************
THIS EMAIL IS INTENDED ONLY FOR THE REVIEW OF THE ADDRESSEE(S), AND MAY
CONTAIN CONFIDENTIAL AND LEGALLY PRIVILEGED INFORMATION. INTERCEPTION,
COPYING, DISSEMINATION, OR OTHER USE BY OTHER THAN THE ADDRESSEE(S) IS
PROHIBITED AND MAY BE PENALIZED UNDER APPLICABLE PRIVACY LAWS. IF YOU
RECEIVED THIS EMAIL IN ERROR, PLEASE DELETE IT AND NOTIFY ME BY RETURN
EMAIL TO eric.hamacher@enetrix.com *******************************
RE: Commons IO FileUtils question
Posted by Eric Hamacher <er...@enetrix.com>.
Everything is working fine now. Don't know what was going on before.
Thanks for all the feedback!
Eric
-----Original Message-----
From: sebb [mailto:sebbaz@gmail.com]
Sent: Tuesday, July 01, 2008 7:57 AM
To: Commons Users List
Subject: Re: Commons IO FileUtils question
On 30/06/2008, Niall Pemberton <ni...@gmail.com> wrote:
> On Mon, Jun 30, 2008 at 8:15 PM, Eric Hamacher
> <er...@enetrix.com> wrote:
> > Hello:
> >
> > I took a file on my filesystem, copied and renamed it. I took the
two
> > files and compared them using FileUtils.contentEquals(File, File).
In
> > this case, shouldn't the method return true? If not, when would it
> > return true?
>
>
> Yes it should return true. Can you use a debugger to find out which
> line in FileUtils is returning false? Also best to say which version
> of Commons IO you are using.
>
Just a thought: if you are using a Windows file system, the copy
command can sometimes change the file, e.g. if there is an EOF (^Z)
character in the file, then copy /a will stop copying after the EOF
character.
This will show up as different file lengths.
> Niall
>
> >
> > Thanks
> >
> >
> >
> > Regards,
> >
> > Eric Hamacher
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
Re: Commons IO FileUtils question
Posted by sebb <se...@gmail.com>.
On 30/06/2008, Niall Pemberton <ni...@gmail.com> wrote:
> On Mon, Jun 30, 2008 at 8:15 PM, Eric Hamacher
> <er...@enetrix.com> wrote:
> > Hello:
> >
> > I took a file on my filesystem, copied and renamed it. I took the two
> > files and compared them using FileUtils.contentEquals(File, File). In
> > this case, shouldn't the method return true? If not, when would it
> > return true?
>
>
> Yes it should return true. Can you use a debugger to find out which
> line in FileUtils is returning false? Also best to say which version
> of Commons IO you are using.
>
Just a thought: if you are using a Windows file system, the copy
command can sometimes change the file, e.g. if there is an EOF (^Z)
character in the file, then copy /a will stop copying after the EOF
character.
This will show up as different file lengths.
> Niall
>
> >
> > Thanks
> >
> >
> >
> > Regards,
> >
> > Eric Hamacher
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
Re: Commons IO FileUtils question
Posted by Niall Pemberton <ni...@gmail.com>.
On Mon, Jun 30, 2008 at 8:15 PM, Eric Hamacher
<er...@enetrix.com> wrote:
> Hello:
>
> I took a file on my filesystem, copied and renamed it. I took the two
> files and compared them using FileUtils.contentEquals(File, File). In
> this case, shouldn't the method return true? If not, when would it
> return true?
Yes it should return true. Can you use a debugger to find out which
line in FileUtils is returning false? Also best to say which version
of Commons IO you are using.
Niall
>
> Thanks
>
>
>
> Regards,
>
> Eric Hamacher
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org