• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems while copying an executable file

 
Manish Hatwalne
Ranch Hand
Posts: 2591
Android Firefox Browser Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to copy a compiled, execuatable file from one directory to another using ant task - copy. However, the file gets opied but its executable attribute "X" is stripped, so the file is no more executable. How can I preserve the files "X" attribute?

This is what I have used -
<copy todir="${riepath}" file="/my_source_path_here/name_of_execuatble">
</copy>

TIA,
- Manish
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Ant documentation suggests a solution towards the bottom of the copy task documentation.
[ July 26, 2004: Message edited by: Dirk Schreckmann ]
 
Manish Hatwalne
Ranch Hand
Posts: 2591
Android Firefox Browser Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right! Here it is -

<quote>
Unix Note: File permissions are not retained when files are copied; they end up with the default UMASK permissions instead. This is caused by the lack of any means to query or set file permissions in the current Java runtimes. If you need a permission-preserving copy function, use <exec executable="cp" ... > instead.
</quote>

But I need something which is portable, so what's the solution?

rgds,
- Manish
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic