ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <>
Subject RE: building a fileset with specific permissions?
Date Thu, 07 Jun 2001 15:47:43 GMT
Actually, you're hitting up against several problems. The first is that
running find from an <exec> will run the DOS find command unless you
specify the full-path to pick up the Cygwin one (haven't been able to
figure out why though), or unless you <exec> 'sh' and run the find from
there. The second is that the <chmod> task won't run under Cygwin (see the
isValidOS() function in The third is: Why are you limiting
your find to .java files, but <fixcrlf>'ing every file, regardless of its
name? And the fourth is just from my perspective -- why are you
circumventing your SCM tool, and making changes to un-checked-out files?

Putting the fourth one aside, you'll need to deal with the chmod'ing using
the 'chmod' command (which means no "excludesfile", so you'll need to
capture the list of read-only files instead of writable ones).

--- Mark Ashton <> wrote:
> Well, I thought I had found a rather clever way to do this:
>   <target name = "beautify" description = 
>     "Cleans up line feeds and tabs if you are in cygwin" >
>     <!-- find the writable source files so we don't chmod them back to 
>          read-only -->
>     <exec executable = "find" output = "writable_source_files">
>         <arg line = "-perm 644 -name *.java"/>
>     </exec>
>     <chmod dir = "${src.dir}" perm = "+w"/>
>     <fixcrlf srcDir = "${src.dir}" cr = "${carriageReturn}" tab =
> "${tabs}"
>         tablength = "${tablength}" />
>     <chmod dir = "${src.dir}" perm = "-w" excludesfile = 
>         "writable_source_files" />
>     <delete file = "writable_source_files" />
>   </target>
> Unfortunately, it seems the exec command is complaining, and that the
> chmod
> is not working. Does this mean that despite the fact that I am running
> under
> cygwin, any sort of commands exec'ed from ant will be executed in a DOS
> environment?
> The chmod just doesn't work - when I get to the fixcrlf task, everything
> is
> still read-only. There's no output from the chmod task running ant -v.
> The
> output from the find command is this: 
> File not found - *.java
> -----Original Message-----
> From: Mark Ashton []
> Sent: Thursday, June 07, 2001 8:52 AM
> To: ''
> Subject: building a fileset with specific permissions?
> We have one of those locking source-control systems here that gets all
> files
> as read-only, unless you lock them, in which case it gives you write
> permissions. I want to set up a FixCRLF task to fix some of the heinous
> crimes against linefeeding and tabbing I see going on in our
> sourcefiles.
> For it to work, it obviously needs to be able to write to the source
> files.
> What I'd like to do is chmod all the files with +w, fixcrlf, and then
> chmod
> them back. The problem arises when I have files checked out, which will
> already be +w. A blind "chmod +w" on the files under my source dir will
> make
> all those files I have locks on become read-only. A minor annoyance, to
> be
> sure, but I'd rather not have to worry about it.
> Is there any way to build a fileset of all the files that are read-only
> underneath a certain directory? This on win2k under cygwin, if that
> makes a
> difference.
> Thanks in advance!
> -- 
> Mark Ashton


Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!

View raw message