Subversion Repositories SvarDOS

Rev

Rev 219 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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