5 typedef HANDLE FileHandle;
6 #define BAD_HANDLE INVALID_HANDLE_VALUE
8 typedef FILE* FileHandle;
9 #define BAD_HANDLE NULL
14 enum FILE_HANDLETYPE {FILE_HANDLENORMAL,FILE_HANDLESTD,FILE_HANDLEERR};
16 enum FILE_ERRORTYPE {FILE_SUCCESS,FILE_NOTFOUND,FILE_READERROR};
33 //void AddFileToList(FileHandle hFile);
40 FILE_HANDLETYPE HandleType;
42 bool IgnoreReadErrors;
52 FILE_ERRORTYPE ErrorType;
58 void operator = (File &SrcFile);
59 bool Open(const char *Name,const wchar *NameW=NULL,bool OpenShared=false,bool Update=false);
60 void TOpen(const char *Name,const wchar *NameW=NULL);
61 bool WOpen(const char *Name,const wchar *NameW=NULL);
62 bool Create(const char *Name,const wchar *NameW=NULL);
63 void TCreate(const char *Name,const wchar *NameW=NULL);
64 bool WCreate(const char *Name,const wchar *NameW=NULL);
68 bool Rename(const char *NewName);
69 void Write(const void *Data,int Size);
70 int Read(void *Data,int Size);
71 int DirectRead(void *Data,int Size);
72 void Seek(Int64 Offset,int Method);
73 bool RawSeek(Int64 Offset,int Method);
75 void Prealloc(Int64 Size);
77 void PutByte(byte Byte);
79 void SetOpenFileTime(RarTime *ftm,RarTime *ftc=NULL,RarTime *fta=NULL);
80 void SetCloseFileTime(RarTime *ftm,RarTime *fta=NULL);
81 static void SetCloseFileTimeByName(const char *Name,RarTime *ftm,RarTime *fta);
82 void SetOpenFileStat(RarTime *ftm,RarTime *ftc,RarTime *fta);
83 void SetCloseFileStat(RarTime *ftm,RarTime *fta,uint FileAttr);
84 void GetOpenFileTime(RarTime *ft);
85 //bool IsOpened() {return(hFile!=BAD_HANDLE);};
86 bool IsOpened() {return true;}; // wtf
88 void SetHandleType(FILE_HANDLETYPE Type);
89 FILE_HANDLETYPE GetHandleType() {return(HandleType);};
91 void fprintf(const char *fmt,...);
92 static bool RemoveCreated();
93 //FileHandle GetHandle() {return(hFile);};
94 void SetIgnoreReadErrors(bool Mode) {IgnoreReadErrors=Mode;};
95 char *GetName() {return(FileName);}
96 long Copy(File &Dest,Int64 Length=INT64ERR);
97 void SetAllowDelete(bool Allow) {AllowDelete=Allow;}
98 void SetExceptions(bool Allow) {AllowExceptions=Allow;}