1 /* -*-C-*-
2 
3 Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
4     1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
5     2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Massachusetts
6     Institute of Technology
7 
8 This file is part of MIT/GNU Scheme.
9 
10 MIT/GNU Scheme is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or (at
13 your option) any later version.
14 
15 MIT/GNU Scheme is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 General Public License for more details.
19 
20 You should have received a copy of the GNU General Public License
21 along with MIT/GNU Scheme; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
23 USA.
24 
25 */
26 
27 #ifndef SCM_OSFS_H
28 #define SCM_OSFS_H
29 
30 #include "os.h"
31 
32 enum file_existence { file_does_exist, file_doesnt_exist, file_is_link };
33 
34 enum file_type
35 {
36   file_type_nonexistent = (-1),
37   file_type_regular = 0,
38   file_type_directory,
39   file_type_unix_symbolic_link,
40   file_type_unix_character_device,
41   file_type_unix_block_device,
42   file_type_unix_fifo,
43   file_type_unix_stream_socket,
44   file_type_os2_named_pipe,
45   file_type_win32_named_pipe,
46   file_type_unknown = 0xFFFF
47 };
48 
49 extern enum file_existence OS_file_existence_test (const char *);
50 extern enum file_existence OS_file_existence_test_direct (const char *);
51 extern enum file_type OS_file_type_direct (const char *);
52 extern enum file_type OS_file_type_indirect (const char *);
53 extern int OS_file_access (const char *, unsigned int);
54 extern int OS_file_directory_p (const char *);
55 extern const char * OS_file_soft_link_p (const char *);
56 extern void OS_file_remove (const char *);
57 extern void OS_file_remove_link (const char *);
58 extern void OS_file_rename (const char *, const char *);
59 extern void OS_file_link_hard (const char *, const char *);
60 extern void OS_file_link_soft (const char *, const char *);
61 extern void OS_directory_make (const char *);
62 extern void OS_directory_delete (const char *);
63 extern int OS_file_touch (const char *);
64 extern unsigned int OS_directory_open (const char *);
65 extern int OS_directory_valid_p (unsigned int);
66 extern void OS_directory_close (unsigned int);
67 extern const char * OS_directory_read (unsigned int);
68 extern const char * OS_directory_read_matching (unsigned int, const char *);
69 extern int OS_channel_copy (off_t, Tchannel, Tchannel);
70 extern void OS_file_copy (const char *, const char *);
71 
72 #endif /* SCM_OSFS_H */
73