2 * file-io.h: File IO internal calls
5 * Dick Porter (dick@ximian.com)
6 * Dan Lewis (dihlewis@yahoo.co.uk)
8 * (C) 2001 Ximian, Inc.
11 #ifndef _MONO_METADATA_FILEIO_H_
12 #define _MONO_METADATA_FILEIO_H_
17 #include <mono/metadata/object-internals.h>
18 #include <mono/io-layer/io-layer.h>
19 #include <mono/utils/mono-compiler.h>
23 /* This is a copy of System.IO.FileAccess */
26 FileAccess_Write=0x02,
27 FileAccess_ReadWrite=FileAccess_Read|FileAccess_Write
30 /* This is a copy of System.IO.FileMode */
35 FileMode_OpenOrCreate=4,
40 /* This is a copy of System.IO.FileShare */
45 FileShare_ReadWrite=FileShare_Read|FileShare_Write,
49 /* This is a copy of System.IO.FileOptions */
52 FileOptions_Temporary = 1, // Internal. See note in System.IO.FileOptions
53 FileOptions_Encrypted = 0x4000,
54 FileOptions_DeleteOnClose = 0x4000000,
55 FileOptions_SequentialScan = 0x8000000,
56 FileOptions_RandomAccess = 0x10000000,
57 FileOptions_Asynchronous = 0x40000000,
58 FileOptions_WriteThrough = 0x80000000
61 /* This is a copy of System.IO.SeekOrigin */
68 /* This is a copy of System.IO.MonoIOStat */
69 typedef struct _MonoIOStat {
74 gint64 last_access_time;
75 gint64 last_write_time;
78 /* This is a copy of System.IO.FileAttributes */
80 FileAttributes_ReadOnly=0x00001,
81 FileAttributes_Hidden=0x00002,
82 FileAttributes_System=0x00004,
83 FileAttributes_Directory=0x00010,
84 FileAttributes_Archive=0x00020,
85 FileAttributes_Device=0x00040,
86 FileAttributes_Normal=0x00080,
87 FileAttributes_Temporary=0x00100,
88 FileAttributes_SparseFile=0x00200,
89 FileAttributes_ReparsePoint=0x00400,
90 FileAttributes_Compressed=0x00800,
91 FileAttributes_Offline=0x01000,
92 FileAttributes_NotContentIndexed=0x02000,
93 FileAttributes_Encrypted=0x04000,
94 FileAttributes_MonoExecutable= (int) 0x80000000
97 typedef struct _MonoFSAsyncResult {
100 MonoBoolean completed;
103 MonoWaitHandle *wait_handle;
104 MonoDelegate *async_callback;
105 MonoBoolean completed_synch;
111 MonoDelegate *real_cb;
114 /* System.IO.MonoIO */
117 ves_icall_System_IO_MonoIO_CreateDirectory (MonoString *path, gint32 *error) MONO_INTERNAL;
120 ves_icall_System_IO_MonoIO_RemoveDirectory (MonoString *path, gint32 *error) MONO_INTERNAL;
123 ves_icall_System_IO_MonoIO_GetFileSystemEntries (MonoString *path,
124 MonoString *path_with_pattern,
125 gint mask, gint attrs,
126 gint32 *error) MONO_INTERNAL;
129 ves_icall_System_IO_MonoIO_GetCurrentDirectory (gint32 *error) MONO_INTERNAL;
132 ves_icall_System_IO_MonoIO_SetCurrentDirectory (MonoString *path,
133 gint32 *error) MONO_INTERNAL;
136 ves_icall_System_IO_MonoIO_MoveFile (MonoString *path, MonoString *dest,
137 gint32 *error) MONO_INTERNAL;
140 ves_icall_System_IO_MonoIO_CopyFile (MonoString *path, MonoString *dest,
141 MonoBoolean overwrite, gint32 *error) MONO_INTERNAL;
144 ves_icall_System_IO_MonoIO_DeleteFile (MonoString *path, gint32 *error) MONO_INTERNAL;
147 ves_icall_System_IO_MonoIO_GetFileAttributes (MonoString *path, gint32 *error) MONO_INTERNAL;
150 ves_icall_System_IO_MonoIO_SetFileAttributes (MonoString *path, gint32 attrs,
151 gint32 *error) MONO_INTERNAL;
154 ves_icall_System_IO_MonoIO_GetFileType (HANDLE handle, gint32 *error) MONO_INTERNAL;
157 ves_icall_System_IO_MonoIO_GetFileStat (MonoString *path, MonoIOStat *stat,
158 gint32 *error) MONO_INTERNAL;
161 ves_icall_System_IO_MonoIO_Open (MonoString *filename, gint32 mode,
162 gint32 access_mode, gint32 share, gint32 options,
163 gint32 *error) MONO_INTERNAL;
166 ves_icall_System_IO_MonoIO_Close (HANDLE handle, gint32 *error) MONO_INTERNAL;
169 ves_icall_System_IO_MonoIO_Read (HANDLE handle, MonoArray *dest,
170 gint32 dest_offset, gint32 count,
171 gint32 *error) MONO_INTERNAL;
174 ves_icall_System_IO_MonoIO_Write (HANDLE handle, MonoArray *src,
175 gint32 src_offset, gint32 count,
176 gint32 *error) MONO_INTERNAL;
179 ves_icall_System_IO_MonoIO_Seek (HANDLE handle, gint64 offset, gint32 origin,
180 gint32 *error) MONO_INTERNAL;
183 ves_icall_System_IO_MonoIO_Flush (HANDLE handle, gint32 *error) MONO_INTERNAL;
186 ves_icall_System_IO_MonoIO_GetLength (HANDLE handle, gint32 *error) MONO_INTERNAL;
189 ves_icall_System_IO_MonoIO_SetLength (HANDLE handle, gint64 length,
190 gint32 *error) MONO_INTERNAL;
193 ves_icall_System_IO_MonoIO_SetFileTime (HANDLE handle, gint64 creation_time,
194 gint64 last_access_time,
195 gint64 last_write_time, gint32 *error) MONO_INTERNAL;
198 ves_icall_System_IO_MonoIO_get_ConsoleOutput (void) MONO_INTERNAL;
201 ves_icall_System_IO_MonoIO_get_ConsoleInput (void) MONO_INTERNAL;
204 ves_icall_System_IO_MonoIO_get_ConsoleError (void) MONO_INTERNAL;
207 ves_icall_System_IO_MonoIO_CreatePipe (HANDLE *read_handle,
208 HANDLE *write_handle) MONO_INTERNAL;
211 ves_icall_System_IO_MonoIO_get_VolumeSeparatorChar (void) MONO_INTERNAL;
214 ves_icall_System_IO_MonoIO_get_DirectorySeparatorChar (void) MONO_INTERNAL;
217 ves_icall_System_IO_MonoIO_get_AltDirectorySeparatorChar (void) MONO_INTERNAL;
220 ves_icall_System_IO_MonoIO_get_PathSeparator (void) MONO_INTERNAL;
223 ves_icall_System_IO_MonoIO_get_InvalidPathChars (void) MONO_INTERNAL;
226 ves_icall_System_IO_MonoIO_GetTempPath (MonoString **mono_name) MONO_INTERNAL;
228 extern void ves_icall_System_IO_MonoIO_Lock (HANDLE handle, gint64 position,
229 gint64 length, gint32 *error) MONO_INTERNAL;
230 extern void ves_icall_System_IO_MonoIO_Unlock (HANDLE handle, gint64 position,
231 gint64 length, gint32 *error) MONO_INTERNAL;
235 #endif /* _MONO_METADATA_FILEIO_H_ */