Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

copy error

 
kumar hai
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's changed about that file? Have the contents changed?
 
Tim Holloway
Saloon Keeper
Posts: 18303
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
kumar hai
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic