/*
* file-io.h: File IO internal calls
*
- * Author:
+ * Authors:
* Dick Porter (dick@ximian.com)
+ * Dan Lewis (dihlewis@yahoo.co.uk)
*
* (C) 2001 Ximian, Inc.
*/
SeekOrigin_End=2,
} MonoSeekOrigin;
+/* This is a copy of System.IO.MonoIOStat */
+typedef struct _MonoIOStat {
+ MonoString *name;
+ gint32 attributes;
+ gint64 length;
+ gint64 creation_time;
+ gint64 last_access_time;
+ gint64 last_write_time;
+} MonoIOStat;
+
+/* This is a copy of System.IO.FileAttributes */
+typedef enum {
+ FileAttributes_ReadOnly=0x00001,
+ FileAttributes_Hidden=0x00002,
+ FileAttributes_System=0x00004,
+ FileAttributes_Directory=0x00010,
+ FileAttributes_Archive=0x00020,
+ FileAttributes_Device=0x00040,
+ FileAttributes_Normal=0x00080,
+ FileAttributes_Temporary=0x00100,
+ FileAttributes_SparseFile=0x00200,
+ FileAttributes_ReparsePoint=0x00400,
+ FileAttributes_Compressed=0x00800,
+ FileAttributes_Offline=0x01000,
+ FileAttributes_NotContentIndexed=0x02000,
+ FileAttributes_Encrypted=0x04000,
+ FileAttributes_MonoExecutable=0x80000000,
+} MonoFileAttributes;
+
+/* System.IO.MonoIO */
+
+extern MonoBoolean
+ves_icall_System_IO_MonoIO_CreateDirectory (MonoString *path, gint32 *error);
+
+extern MonoBoolean
+ves_icall_System_IO_MonoIO_RemoveDirectory (MonoString *path, gint32 *error);
+
+extern HANDLE
+ves_icall_System_IO_MonoIO_FindFirstFile (MonoString *path, MonoIOStat *stat,
+ gint32 *error);
+
+extern MonoBoolean
+ves_icall_System_IO_MonoIO_FindNextFile (HANDLE find, MonoIOStat *stat,
+ gint32 *error);
+
+extern MonoBoolean
+ves_icall_System_IO_MonoIO_FindClose (HANDLE find, gint32 *error);
+
+extern MonoString *
+ves_icall_System_IO_MonoIO_GetCurrentDirectory (gint32 *error);
+
+extern MonoBoolean
+ves_icall_System_IO_MonoIO_SetCurrentDirectory (MonoString *path,
+ gint32 *error);
+
+extern MonoBoolean
+ves_icall_System_IO_MonoIO_MoveFile (MonoString *path, MonoString *dest,
+ gint32 *error);
+
+extern MonoBoolean
+ves_icall_System_IO_MonoIO_CopyFile (MonoString *path, MonoString *dest,
+ MonoBoolean overwrite, gint32 *error);
+
+extern MonoBoolean
+ves_icall_System_IO_MonoIO_DeleteFile (MonoString *path, gint32 *error);
+
+extern gint32
+ves_icall_System_IO_MonoIO_GetFileAttributes (MonoString *path, gint32 *error);
+
+extern MonoBoolean
+ves_icall_System_IO_MonoIO_SetFileAttributes (MonoString *path, gint32 attrs,
+ gint32 *error);
-extern HANDLE ves_icall_System_PAL_OpSys_GetStdHandle(MonoObject *this, gint32 fs);
-extern gint32 ves_icall_System_PAL_OpSys_ReadFile(MonoObject *this, HANDLE handle, MonoArray *buffer, gint32 offset, gint32 count);
-extern gint32 ves_icall_System_PAL_OpSys_WriteFile(MonoObject *this, HANDLE handle, MonoArray *buffer, gint32 offset, gint32 count);
-extern gint32 ves_icall_System_PAL_OpSys_SetLengthFile(MonoObject *this, HANDLE handle, gint64 length);
-extern HANDLE ves_icall_System_PAL_OpSys_OpenFile(MonoObject *this, MonoString *path, gint32 mode, gint32 access, gint32 share);
-extern void ves_icall_System_PAL_OpSys_CloseFile(MonoObject *this, HANDLE handle);
-extern gint64 ves_icall_System_PAL_OpSys_SeekFile(MonoObject *this, HANDLE handle, gint64 offset, gint32 origin);
-extern void ves_icall_System_PAL_OpSys_DeleteFile(MonoObject *this, MonoString *path);
-extern gboolean ves_icall_System_PAL_OpSys_ExistsFile(MonoObject *this, MonoString *path);
-extern gboolean ves_icall_System_PAL_OpSys_GetFileTime(HANDLE handle, gint64 *createtime, gint64 *lastaccess, gint64 *lastwrite);
-extern gboolean ves_icall_System_PAL_OpSys_SetFileTime(HANDLE handle, gint64 createtime, gint64 lastaccess, gint64 lastwrite);
+extern gint32
+ves_icall_System_IO_MonoIO_GetFileType (HANDLE handle, gint32 *error);
-/* System.IO.FileStream */
+extern MonoBoolean
+ves_icall_System_IO_MonoIO_GetFileStat (MonoString *path, MonoIOStat *stat,
+ gint32 *error);
-extern HANDLE
-ves_icall_System_IO_FileStream_FileOpen (MonoString *filename, gint32 mode, gint32 access, gint32 share);
+extern HANDLE
+ves_icall_System_IO_MonoIO_Open (MonoString *filename, gint32 mode,
+ gint32 access_mode, gint32 share,
+ gint32 *error);
-extern void
-ves_icall_System_IO_FileStream_FileClose (gpointer handle);
+extern MonoBoolean
+ves_icall_System_IO_MonoIO_Close (HANDLE handle, gint32 *error);
extern gint32
-ves_icall_System_IO_FileStream_FileRead (gpointer handle, MonoArray *dest, gint32 dest_offset, gint32 count);
+ves_icall_System_IO_MonoIO_Read (HANDLE handle, MonoArray *dest,
+ gint32 dest_offset, gint32 count,
+ gint32 *error);
extern gint32
-ves_icall_System_IO_FileStream_FileWrite (gpointer handle, MonoArray *src, gint32 src_offset, gint32 count);
+ves_icall_System_IO_MonoIO_Write (HANDLE handle, MonoArray *src,
+ gint32 src_offset, gint32 count,
+ gint32 *error);
extern gint64
-ves_icall_System_IO_FileStream_FileSeek (gpointer handle, gint64 offset, gint32 origin);
+ves_icall_System_IO_MonoIO_Seek (HANDLE handle, gint64 offset, gint32 origin,
+ gint32 *error);
+
+extern MonoBoolean
+ves_icall_System_IO_MonoIO_Flush (HANDLE handle, gint32 *error);
extern gint64
-ves_icall_System_IO_FileStream_FileGetLength (gpointer handle);
+ves_icall_System_IO_MonoIO_GetLength (HANDLE handle, gint32 *error);
+
+extern MonoBoolean
+ves_icall_System_IO_MonoIO_SetLength (HANDLE handle, gint64 length,
+ gint32 *error);
+
+extern MonoBoolean
+ves_icall_System_IO_MonoIO_SetFileTime (HANDLE handle, gint64 creation_time,
+ gint64 last_access_time,
+ gint64 last_write_time, gint32 *error);
+
+extern HANDLE
+ves_icall_System_IO_MonoIO_get_ConsoleOutput (void);
+
+extern HANDLE
+ves_icall_System_IO_MonoIO_get_ConsoleInput (void);
+
+extern HANDLE
+ves_icall_System_IO_MonoIO_get_ConsoleError (void);
+
+extern MonoBoolean
+ves_icall_System_IO_MonoIO_CreatePipe (HANDLE *read_handle,
+ HANDLE *write_handle);
+
+extern gunichar2
+ves_icall_System_IO_MonoIO_get_VolumeSeparatorChar (void);
+
+extern gunichar2
+ves_icall_System_IO_MonoIO_get_DirectorySeparatorChar (void);
+
+extern gunichar2
+ves_icall_System_IO_MonoIO_get_AltDirectorySeparatorChar (void);
+
+extern gunichar2
+ves_icall_System_IO_MonoIO_get_PathSeparator (void);
-extern void
-ves_icall_System_IO_FileStream_FileSetLength (gpointer handle, gint64 length);
+extern MonoArray *
+ves_icall_System_IO_MonoIO_get_InvalidPathChars (void);
-extern void
-ves_icall_System_IO_FileStream_FileFlush (gpointer handle);
+extern gint32
+ves_icall_System_IO_MonoIO_GetTempPath (MonoString **mono_name);
#endif /* _MONO_METADATA_FILEIO_H_ */