ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francis GALIEGUE <...@one2team.com>
Subject Checking whether a file is executable
Date Fri, 23 Oct 2009 20:01:12 GMT
Hello,

Ant's <available> condition can check whether a file exists and is a
regular file (with type="file"), but I have seen no condition that can
tell me whether a given regular file is executable (sorry for the Unix
speak - FWIW, a regular file is just that, a file - a directory is
just another type of file).

Java has .canExecute() which can tell whether a given File object is
executable. Where should I start to look if I want to create, say, a
<isexecutabe> condition? Or is there something existing that I just
overlooked? I could use <exec> and work out the return value, but I'd
be better off if I could fail earlier, finding that a given file is
just not executable at all...

-- 

Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge@one2team.com
40 avenue Raymond Poincaré
75116 Paris

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message