Subversion Repositories SvarDOS

Rev

Rev 269 | Go to most recent revision | Details | Compare with Previous | 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
 
229 mateuszvis 9
int fileexists(const char *filename) {
219 mateuszvis 10
  FILE *fd;
11
  fd = fopen(filename, "rb");
229 mateuszvis 12
  if (fd == NULL) return(0); /* file does not exists */
13
  fclose(fd);
14
  return(1);
219 mateuszvis 15
}