实体

文件 CFileMgr

游戏目录相对路径读写

CFileMgr.h

游戏目录相对路径读写。FILESTREAMint 句柄,不是 FILE*

工作目录

SetDir / ChangeDir / SetDirMyDocuments
static int SetDir(const char* path);
static int ChangeDir(const char* path);
static int SetDirMyDocuments();
static char* ms_dirName;
static char* ms_rootDirName;

打开关闭

OpenFile / CloseFile
static FILESTREAM OpenFile(const char* path, const char* mode);
static FILESTREAM OpenFileForWriting(const char* path);
static FILESTREAM OpenFileForAppending(const char* path);
static int CloseFile(FILESTREAM file);

读写定位

Read / Write / Seek / ReadLine
static int Read(FILESTREAM file, char* buf, int size);
static int Write(FILESTREAM file, char* buf, int size);
static char Seek(FILESTREAM file, int offset, int origin);
static int Tell(FILESTREAM file);
static char ReadLine(FILESTREAM file, char* str, int num);
static int GetFileLength(FILESTREAM file);
static bool GetErrorReadWrite(FILESTREAM file);

一次载入

LoadFile
static int LoadFile(const char* path, unsigned char* buf, int size, const char* mode);

注意

说明
路径相对游戏目录;自定义文件也可用 路径
句柄FILESTREAM ≠ CRT FILE*
ASI 配置简单 ini 优先 plugin::config / 扩展 Config

On this page