execute.c 387 B

12345678910111213141516171819202122
  1. /*
  2. * File: execute.c
  3. * Author: Arthur Brandao
  4. *
  5. * Created on 9 novembre 2018
  6. */
  7. #include <stdio.h>
  8. #include <stdlib.h>
  9. #include <unistd.h>
  10. #include "error.h"
  11. #include "execute.h"
  12. /* --- Fonctions publiques --- */
  13. boolean is_executable_file(const char * cmd) {
  14. int result;
  15. result = access(cmd, X_OK);
  16. if(result == ERR){
  17. return false;
  18. }
  19. return true;
  20. }