ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Connolly <stephen.alan.conno...@gmail.com>
Subject Re: Checking whether a file is executable
Date Tue, 27 Oct 2009 09:17:55 GMT
you might also have a look at jna.dev.java.net as they have some trickery
that allows you to query is a file is executable

2009/10/27 Rebhan, Gilbert <Gilbert.Rebhan@huk-coburg.de>

>
>
>
>
> -----Original Message-----
> From: Francis GALIEGUE [mailto:fge@one2team.com]
> Sent: Friday, October 23, 2009 10:01 PM
> To: Ant Users List
> Subject: Checking whether a file is executable
>
> /*
> 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...
> */
>
> another possibility would be to check, whether the file is binary, see =
> http://marc.info/?l=ant-user&m=118769231408319&w=2
>
>
>
> Regards, Gilbert
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message