Advertisement
Guest User

Untitled

a guest
Dec 5th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.57 KB | None | 0 0
  1. int     my_putstr(char *str)
  2. {
  3.   int   i;
  4.  
  5.   while (str[i] != '\0')
  6.     {
  7.       my_putchar(str[i]);
  8.       i = i + 1;
  9.     }
  10.   return (0);
  11. }
  12.  
  13. int     fs_open_file(char *filepath)
  14. {
  15.   open(filepath, O_PATH)
  16.   if (read(filepath) == 0)
  17.     {
  18.       my_putstr("FAILURE");
  19.       my_putchar('\n');
  20.       return (84);
  21.     }
  22.   my_putstr("SUCCESS");
  23.   my_putchar('\n');
  24.   close(filepath)
  25. }
  26.  
  27. int     main(int argc, char **argv)
  28. {
  29.   int   i;
  30.  
  31.   i = 0;
  32.   argc = 1;
  33.   while (i < argc)
  34.     {
  35.       fs_open_file(argv);
  36.       i = i + 1;
  37.     }
  38.   return (0);
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement