ant-user mailing list archives

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

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
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
40 avenue Raymond Poincaré
75116 Paris

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message