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 "../../pdbox.h"
17 #include <sys/types.h>
21 /* LATER delete this? -- replaced by find_via_path() in s_path.c */
22 int sys_isreadablefile(const char *s
)
27 if((fd
= open(s
, O_RDONLY
)))
37 if (stat(s
, &statbuf
) < 0) return (0);
39 mode
= statbuf
.st_mode
;
40 if (S_ISDIR(mode
)) return (0);
46 /* change '/' characters to the system's native file separator */
47 void sys_bashfilename(const char *from
, char *to
)
53 if (c
== '/') c
= '\\';
61 /* change the system's native file separator to '/' characters */
62 void sys_unbashfilename(const char *from
, char *to
)
68 if (c
== '\\') c
= '/';