using pipeprocess on non-applications

John Colvin via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jul 27 08:54:37 PDT 2014


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.


More information about the Digitalmars-d-learn mailing list