aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes copy error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "copy error" Watch "copy error" New topic
Author

copy error

kumar hai
Greenhorn

Joined: Oct 12, 2009
Posts: 26
Hi,
I am copy few file to one location...file size is 25 bytes after copy this file,bytes value changed.after copy that file size is 102 bytes. Please tell me how to avoid this error..i want original size only...


im using:

<copy includeemptydirs="true" todir="${temp.dir}" preservelastmodified="true">
<fileset dir="${src1.dir}" includes="**/MANIFEST.MF"/>
</copy>


please reply me ..im waiting for your reply
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

What's changed about that file? Have the contents changed?


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16228
    
  21

It's possible that you're doing a text file copy under Windows of a text file that was created in Unix. That would increase the size, size Unix considers a single end-of-line character to be a sufficient indicator, but DOS/Windows uses 2.

Although that's an awful lot of end-of-lines, if that's the case.

Since the files are small, compare them and see what's different.


Customer surveys are for companies who didn't pay proper attention to begin with.
kumar hai
Greenhorn

Joined: Oct 12, 2009
Posts: 26
that file is like header file..& i hope that file created in Window only...

& also while generate ear file or war file im include this file also...that time only i getting this size increase issue...

sorry for previously i mentioned while copy only i got this issue...


real issue...while generate war/ear file i am getting size increase issue...

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5842
    
    7

25 bytes to 102 bytes? Sounds like a conversion from ASCII to 4-byte Unicode, with a 2-byte byte-order-marker at the start of the file. If you have a hex editor, you can use it to verify this. This is probably happening because of the locale settings in your computer. I suspect that such settings can be changed on the JVM command line (you will have to edit ant.bat to apply them), but I don't know what they are.

See the "Important Encoding Note:" at the end of the copy task in the ant docs.


JBoss In Action
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: copy error