1
/* Copyright (c) 1997-1999 Miller Puckette.
2
* For information on usage and redistribution, and for a DISCLAIMER OF ALL
3
* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
6
* this file contains file-handling routines.
11
#include <sys/types.h>
14
/* LATER delete this? -- replaced by find_via_path() in s_path.c */
15
int sys_isreadablefile(const char *s)
19
if (stat(s, &statbuf) < 0) return (0);
21
mode = statbuf.st_mode;
22
if (S_ISDIR(mode)) return (0);
27
/* change '/' characters to the system's native file separator */
28
void sys_bashfilename(const char *from, char *to)
34
if (c == '/') c = '\\';
42
/* change the system's native file separator to '/' characters */
43
void sys_unbashfilename(const char *from, char *to)
49
if (c == '\\') c = '/';