| Author |
Problems while copying an executable file
|
Manish Hatwalne
Ranch Hand
Joined: Sep 22, 2001
Posts: 2573
|
|
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
Joined: Dec 10, 2001
Posts: 7023
|
|
The Ant documentation suggests a solution towards the bottom of the copy task documentation. [ July 26, 2004: Message edited by: Dirk Schreckmann ]
|
[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
|
 |
Manish Hatwalne
Ranch Hand
Joined: Sep 22, 2001
Posts: 2573
|
|
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
|
 |
 |
|
|
subject: Problems while copying an executable file
|
|
|