Quoth br...@lorf.org,

>> execute :: FilePath -> [String] -> IO (Either ExecuteError ExitCode)
>
> where 'ExecuteError' is a data type representing all the ways 'execute'
> could fail and that 'execute p args' is supposed to
>
> * ensure p exists
> * get p's permissions
> * ensure p is readable
> * ensure p is executable

 * read UNIX "magic number" from first 2 bytes of p
   case number of
     "#!" -> interpret rest of line, start validation process over on 
             interpreter file
     valid executable type for OS ->  OK
     _ -> not OK

> * execute p and return its exit code

        Donn

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to