exists.c 234 B

12345678910111213141516
  1. #include <sys/types.h>
  2. #include <sys/stat.h>
  3. #include <unistd.h>
  4. int main(int argc, char *argv[])
  5. {
  6. struct stat s;
  7. if(argc < 2) return 1;
  8. if(stat(argv[1], &s)) {
  9. return 1;
  10. } else {
  11. return 0;
  12. }
  13. }