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>
20 /* This is a copy of System.IO.FileAccess */
23 FileAccess_Write
=0x02,
24 FileAccess_ReadWrite
=FileAccess_Read
|FileAccess_Write
27 /* This is a copy of System.IO.FileMode */
32 FileMode_OpenOrCreate
=4,
37 /* This is a copy of System.IO.FileShare */
42 FileShare_ReadWrite
=FileShare_Read
|FileShare_Write
45 /* This is a copy of System.IO.SeekOrigin */
52 /* This is a copy of System.IO.MonoIOStat */
53 typedef struct _MonoIOStat
{
58 gint64 last_access_time
;
59 gint64 last_write_time
;
62 /* This is a copy of System.IO.FileAttributes */
64 FileAttributes_ReadOnly
=0x00001,
65 FileAttributes_Hidden
=0x00002,
66 FileAttributes_System
=0x00004,
67 FileAttributes_Directory
=0x00010,
68 FileAttributes_Archive
=0x00020,
69 FileAttributes_Device
=0x00040,
70 FileAttributes_Normal
=0x00080,
71 FileAttributes_Temporary
=0x00100,
72 FileAttributes_SparseFile
=0x00200,
73 FileAttributes_ReparsePoint
=0x00400,
74 FileAttributes_Compressed
=0x00800,
75 FileAttributes_Offline
=0x01000,
76 FileAttributes_NotContentIndexed
=0x02000,
77 FileAttributes_Encrypted
=0x04000,
78 FileAttributes_MonoExecutable
= (int) 0x80000000
81 typedef struct _MonoFSAsyncResult
{
84 MonoBoolean completed
;
87 MonoWaitHandle
*wait_handle
;
88 MonoDelegate
*async_callback
;
89 MonoBoolean completed_synch
;
95 MonoDelegate
*real_cb
;
99 typedef struct _WapiOverlapped WapiOverlapped
;
101 struct _WapiOverlapped
104 guint32 InternalHigh
;
113 /* System.IO.MonoIO */
116 ves_icall_System_IO_MonoIO_CreateDirectory (MonoString
*path
, gint32
*error
);
119 ves_icall_System_IO_MonoIO_RemoveDirectory (MonoString
*path
, gint32
*error
);
122 ves_icall_System_IO_MonoIO_FindFirstFile (MonoString
*path
, MonoIOStat
*stat
,
126 ves_icall_System_IO_MonoIO_FindNextFile (HANDLE find
, MonoIOStat
*stat
,
130 ves_icall_System_IO_MonoIO_FindClose (HANDLE find
, gint32
*error
);
133 ves_icall_System_IO_MonoIO_GetCurrentDirectory (gint32
*error
);
136 ves_icall_System_IO_MonoIO_SetCurrentDirectory (MonoString
*path
,
140 ves_icall_System_IO_MonoIO_MoveFile (MonoString
*path
, MonoString
*dest
,
144 ves_icall_System_IO_MonoIO_CopyFile (MonoString
*path
, MonoString
*dest
,
145 MonoBoolean overwrite
, gint32
*error
);
148 ves_icall_System_IO_MonoIO_DeleteFile (MonoString
*path
, gint32
*error
);
151 ves_icall_System_IO_MonoIO_GetFileAttributes (MonoString
*path
, gint32
*error
);
154 ves_icall_System_IO_MonoIO_SetFileAttributes (MonoString
*path
, gint32 attrs
,
158 ves_icall_System_IO_MonoIO_GetFileType (HANDLE handle
, gint32
*error
);
161 ves_icall_System_IO_MonoIO_GetFileStat (MonoString
*path
, MonoIOStat
*stat
,
165 ves_icall_System_IO_MonoIO_Open (MonoString
*filename
, gint32 mode
,
166 gint32 access_mode
, gint32 share
,
167 MonoBoolean async
, gint32
*error
);
170 ves_icall_System_IO_MonoIO_Close (HANDLE handle
, gint32
*error
);
173 ves_icall_System_IO_MonoIO_Read (HANDLE handle
, MonoArray
*dest
,
174 gint32 dest_offset
, gint32 count
,
178 ves_icall_System_IO_MonoIO_Write (HANDLE handle
, MonoArray
*src
,
179 gint32 src_offset
, gint32 count
,
183 ves_icall_System_IO_MonoIO_Seek (HANDLE handle
, gint64 offset
, gint32 origin
,
187 ves_icall_System_IO_MonoIO_Flush (HANDLE handle
, gint32
*error
);
190 ves_icall_System_IO_MonoIO_GetLength (HANDLE handle
, gint32
*error
);
193 ves_icall_System_IO_MonoIO_SetLength (HANDLE handle
, gint64 length
,
197 ves_icall_System_IO_MonoIO_SetFileTime (HANDLE handle
, gint64 creation_time
,
198 gint64 last_access_time
,
199 gint64 last_write_time
, gint32
*error
);
202 ves_icall_System_IO_MonoIO_get_ConsoleOutput (void);
205 ves_icall_System_IO_MonoIO_get_ConsoleInput (void);
208 ves_icall_System_IO_MonoIO_get_ConsoleError (void);
211 ves_icall_System_IO_MonoIO_CreatePipe (HANDLE
*read_handle
,
212 HANDLE
*write_handle
);
215 ves_icall_System_IO_MonoIO_get_VolumeSeparatorChar (void);
218 ves_icall_System_IO_MonoIO_get_DirectorySeparatorChar (void);
221 ves_icall_System_IO_MonoIO_get_AltDirectorySeparatorChar (void);
224 ves_icall_System_IO_MonoIO_get_PathSeparator (void);
227 ves_icall_System_IO_MonoIO_get_InvalidPathChars (void);
230 ves_icall_System_IO_MonoIO_GetTempPath (MonoString
**mono_name
);
233 ves_icall_System_IO_MonoIO_GetSupportsAsync (void);
236 ves_icall_System_IO_MonoIO_BeginRead (HANDLE handle
, MonoFSAsyncResult
*ares
);
239 ves_icall_System_IO_MonoIO_BeginWrite (HANDLE handle
, MonoFSAsyncResult
*ares
);
241 extern void ves_icall_System_IO_MonoIO_Lock (HANDLE handle
, gint64 position
,
242 gint64 length
, gint32
*error
);
243 extern void ves_icall_System_IO_MonoIO_Unlock (HANDLE handle
, gint64 position
,
244 gint64 length
, gint32
*error
);
246 #endif /* _MONO_METADATA_FILEIO_H_ */