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>
22 /* This is a copy of System.IO.FileAccess */
25 FileAccess_Write=0x02,
26 FileAccess_ReadWrite=FileAccess_Read|FileAccess_Write
29 /* This is a copy of System.IO.FileMode */
34 FileMode_OpenOrCreate=4,
39 /* This is a copy of System.IO.FileShare */
44 FileShare_ReadWrite=FileShare_Read|FileShare_Write
47 /* This is a copy of System.IO.SeekOrigin */
54 /* This is a copy of System.IO.MonoIOStat */
55 typedef struct _MonoIOStat {
60 gint64 last_access_time;
61 gint64 last_write_time;
64 /* This is a copy of System.IO.FileAttributes */
66 FileAttributes_ReadOnly=0x00001,
67 FileAttributes_Hidden=0x00002,
68 FileAttributes_System=0x00004,
69 FileAttributes_Directory=0x00010,
70 FileAttributes_Archive=0x00020,
71 FileAttributes_Device=0x00040,
72 FileAttributes_Normal=0x00080,
73 FileAttributes_Temporary=0x00100,
74 FileAttributes_SparseFile=0x00200,
75 FileAttributes_ReparsePoint=0x00400,
76 FileAttributes_Compressed=0x00800,
77 FileAttributes_Offline=0x01000,
78 FileAttributes_NotContentIndexed=0x02000,
79 FileAttributes_Encrypted=0x04000,
80 FileAttributes_MonoExecutable= (int) 0x80000000
83 typedef struct _MonoFSAsyncResult {
86 MonoBoolean completed;
89 MonoWaitHandle *wait_handle;
90 MonoDelegate *async_callback;
91 MonoBoolean completed_synch;
97 MonoDelegate *real_cb;
100 /* System.IO.MonoIO */
103 ves_icall_System_IO_MonoIO_CreateDirectory (MonoString *path, gint32 *error);
106 ves_icall_System_IO_MonoIO_RemoveDirectory (MonoString *path, gint32 *error);
109 ves_icall_System_IO_MonoIO_GetFileSystemEntries (MonoString *_path, MonoString *_pattern,
110 gint mask, gint attrs, gint32 *error);
113 ves_icall_System_IO_MonoIO_GetCurrentDirectory (gint32 *error);
116 ves_icall_System_IO_MonoIO_SetCurrentDirectory (MonoString *path,
120 ves_icall_System_IO_MonoIO_MoveFile (MonoString *path, MonoString *dest,
124 ves_icall_System_IO_MonoIO_CopyFile (MonoString *path, MonoString *dest,
125 MonoBoolean overwrite, gint32 *error);
128 ves_icall_System_IO_MonoIO_DeleteFile (MonoString *path, gint32 *error);
131 ves_icall_System_IO_MonoIO_GetFileAttributes (MonoString *path, gint32 *error);
134 ves_icall_System_IO_MonoIO_SetFileAttributes (MonoString *path, gint32 attrs,
138 ves_icall_System_IO_MonoIO_GetFileType (HANDLE handle, gint32 *error);
141 ves_icall_System_IO_MonoIO_GetFileStat (MonoString *path, MonoIOStat *stat,
145 ves_icall_System_IO_MonoIO_Open (MonoString *filename, gint32 mode,
146 gint32 access_mode, gint32 share,
147 MonoBoolean async, gint32 *error);
150 ves_icall_System_IO_MonoIO_Close (HANDLE handle, gint32 *error);
153 ves_icall_System_IO_MonoIO_Read (HANDLE handle, MonoArray *dest,
154 gint32 dest_offset, gint32 count,
158 ves_icall_System_IO_MonoIO_Write (HANDLE handle, MonoArray *src,
159 gint32 src_offset, gint32 count,
163 ves_icall_System_IO_MonoIO_Seek (HANDLE handle, gint64 offset, gint32 origin,
167 ves_icall_System_IO_MonoIO_Flush (HANDLE handle, gint32 *error);
170 ves_icall_System_IO_MonoIO_GetLength (HANDLE handle, gint32 *error);
173 ves_icall_System_IO_MonoIO_SetLength (HANDLE handle, gint64 length,
177 ves_icall_System_IO_MonoIO_SetFileTime (HANDLE handle, gint64 creation_time,
178 gint64 last_access_time,
179 gint64 last_write_time, gint32 *error);
182 ves_icall_System_IO_MonoIO_get_ConsoleOutput (void);
185 ves_icall_System_IO_MonoIO_get_ConsoleInput (void);
188 ves_icall_System_IO_MonoIO_get_ConsoleError (void);
191 ves_icall_System_IO_MonoIO_CreatePipe (HANDLE *read_handle,
192 HANDLE *write_handle);
195 ves_icall_System_IO_MonoIO_get_VolumeSeparatorChar (void);
198 ves_icall_System_IO_MonoIO_get_DirectorySeparatorChar (void);
201 ves_icall_System_IO_MonoIO_get_AltDirectorySeparatorChar (void);
204 ves_icall_System_IO_MonoIO_get_PathSeparator (void);
207 ves_icall_System_IO_MonoIO_get_InvalidPathChars (void);
210 ves_icall_System_IO_MonoIO_GetTempPath (MonoString **mono_name);
212 extern void ves_icall_System_IO_MonoIO_Lock (HANDLE handle, gint64 position,
213 gint64 length, gint32 *error);
214 extern void ves_icall_System_IO_MonoIO_Unlock (HANDLE handle, gint64 position,
215 gint64 length, gint32 *error);
219 #endif /* _MONO_METADATA_FILEIO_H_ */