The core problem is that there is no 100% pure Java way to get or set file permissions. See JSR 203 (http://www.jcp.org/en/jsr/detail?id=203)
____________________________________________________________________________________________
Jeffrey E. (Jeff) Care
IBM WebSphere Application Server Development
WAS Pyxis Lead Release Engineer
WebSphere Mosiac
WebSphere Brandmark



"Brown, Carlton" <[EMAIL PROTECTED]> wrote on 04/07/2006 01:37:47 PM:

> All:
>
>  
>
> I have found a dilemma on what ought to be a simple task.   I need to
> copy some files from one location to another and run them through a
> filter.
>
>  
>
> OK, great.  Ant has filters I can use.
>
> Wait... these are scripts.  They need to be executable.
>
> Ant's copy task doesn't preserve file permissions.  
>
> According to the manual, if you want file permissions preserved, either
> you set your default umask or exec out to a "cp" command.
>
> But apparently umask isn't really a simple mathematical permissions
> mask.  Setting a umask of 000 won't give you rwx permissions, for
> example.
>
> And if I resort to exec'ing the cp command, then I can't use the filters
> I wanted to use.
>
> The only thing remaining is a kludge that captures the states of the
> files before copy and then uses chmod to restore them after the copy.
> That's cheesy and I don't want to do it.
>
>  
>
> Anybody run into this before?
>
>
> *****
>
> The information transmitted is intended only for the person or
> entity to which it is addressed and may contain confidential,
> proprietary, and/or privileged material. Any review, retransmission,
> dissemination or other use of, or taking of any action in reliance
> upon this information by persons or entities other than the intended
> recipient is prohibited. If you received this in error, please
> contact the sender and delete the material from all computers. 117
>
>

Reply via email to