www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - using pipeprocess on non-applications

reply "Sean Campbell" <sycam.inc gmail.com> writes:
is there any way to detect if a file is a binary executable that 
is cross platform or a way to detect whether pipeprocss failed to 
execute a file if it wasn't executable.
Jul 26 2014
parent "John Colvin" <john.loughran.colvin gmail.com> writes:
On Saturday, 26 July 2014 at 15:24:01 UTC, Sean Campbell wrote:
 is there any way to detect if a file is a binary executable 
 that is cross platform or a way to detect whether pipeprocss 
 failed to execute a file if it wasn't executable.
pipeProcess will throw a ProcessException if it can't start an executable. Checking the type of a file, permissions, availability of necessary shared libraries etc. can be checked with a variety of unix tools (file, ldd, stat). There are c functions for accessing this information which you can import from core.stdc Don't know about Windows but I presume the same applies.
Jul 27 2014