Subversion Repositories SvarDOS

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
219 mateuszvis 1
/*
2
 * fileexists checks whether a file exists or not.
3
 * returns 0 if file not found, non-zero otherwise.
4
 */
5
 
6
#include <stdio.h>
7
#include "fileexst.h"
8
#include "version.h"
9
 
10
int fileexists(char *filename) {
11
  FILE *fd;
12
  fd = fopen(filename, "rb");
13
  if (fd != NULL) { /* file exists */
14
      fclose(fd);
15
      return(1);
16
    } else {
17
      return(0);
18
  }
19
}