ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Ashton <>
Subject RE: building a fileset with specific permissions?
Date Thu, 07 Jun 2001 14:21:41 GMT
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"/>
    <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" />

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

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

Thanks in advance!

Mark Ashton

View raw message