ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Larry V. Streepy, Jr." <stre...@healthlanguage.com>
Subject Re: building a fileset with specific permissions?
Date Thu, 07 Jun 2001 15:12:25 GMT
Unfortunately, exactly how the command is executed is based on both the
platform and the current JDK revision.

If you're on JDK 1.3, then it uses Runtime.exec() which quickly dives
into native code.  Under 1.1 or 1.2, it uses the antRun wrapper script
to change directories and then execute the command.  Note that on
Windows, this is the antRun.bat file.

So, my guess is that your PATH setting is causing you to find the wrong
"find" command from within the batch file.

Just a guess.

It eventually boils down to executing the antRun script

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 [mailto:mashton@Novarra.com]
> Sent: Thursday, June 07, 2001 8:52 AM
> To: 'ant-user@jakarta.apache.org'
> 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

-- 
Larry V. Streepy, Jr.
Chief Technical Officer and VP of Engineering

Health Language, Inc.  -- "We speak the language of healthcare"

970/626-5028 (office)           mailto:streepy@healthlanguage.com
970/626-4425 (fax)              http://www.healthlanguage.com

Mime
View raw message