DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=28320>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=28320

copy task preserving permissions





------- Additional Comments From [EMAIL PROTECTED]  2004-04-12 21:01 -------
How against JNI code is ant?

The reason I ask is I did some investigating on *reading* file permissions, 
and the only options are:

1. use ls (which doesn't help much for spitting out ONLY file permissions)
2. use JNI and call the system calls directly from java.
3. write a program similar to chmod which reads file permissions, and use that 
program to read the permissions before copying and chmod'ing them.

I appreciate the response with the perl script, but that isn't an option for 
me as I don't know or use perl.  The problem I'm trying to solve is that I'm 
trying to use ant to build executables (from C++ code), which it is able to do 
just fine (I'm using ant-contrib).  However, when copying the executable to 
the output directory, the file loses its executable permission.

The benefits of using JNI would be greater than just being able to read file 
permissions, you would also be able to set file permissions without having to 
execute another program (i.e. change the chmod task).  You could also easily 
port a JNI version to non-unix filesystems (NTFS comes to mind).

The only drawback, of course, is that to build file permission support, you 
need to have a c-compiler to build the native part of the class.  In my case, 
I have no problem with this.  However, other people may have issues with using 
a C-compiled library with ant.  In reality, it is no different than using 
chmod, since you are in effect using a program built in c to do the dirty work 
that Java does not support.  The build script for ant could also be modified 
to optionally use the old method for chmod in case people are very averse to 
building the JNI interface.

Anyways, I made my case, if the ant developers think this is a BAD idea, then 
I will just not contribute the work that I will inevitably do, as I still need 
to solve the problem, and ant is just way too good to not use for this minor 
issue :)

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to