111
This commit is contained in:
@@ -16,6 +16,7 @@ class IO extends Base_C_Object {
|
||||
_Fseek_Address = Module.getExportByName(null, "fseek");
|
||||
_Ftell_Address = Module.getExportByName(null, "ftell");
|
||||
_Rewind_Address = Module.getExportByName(null, "rewind");
|
||||
_Flush_Address = Module.getExportByName(null, "fflush");
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +26,7 @@ class IO extends Base_C_Object {
|
||||
local FileObj = Sq_CallFunc(_Fopen_Address, "pointer", ["pointer", "pointer"], Str_Ptr(FileName), Str_Ptr(Modes));
|
||||
if (FileObj) {
|
||||
base.constructor(FileObj);
|
||||
} else error("文件打开错误! FileName: " + FileName);
|
||||
} else throw("文件打开错误! FileName: " + FileName);
|
||||
}
|
||||
|
||||
//读取一行
|
||||
@@ -68,6 +69,9 @@ class IO extends Base_C_Object {
|
||||
Sq_CallFunc(_Fputs_Address, "int", ["pointer", "pointer"], Buffer.C_Object, this.C_Object);
|
||||
}
|
||||
|
||||
function Flush() {
|
||||
Sq_CallFunc(_Flush_Address, "pointer", ["pointer"], this.C_Object);
|
||||
}
|
||||
|
||||
//关闭文件
|
||||
function Close() {
|
||||
|
||||
Reference in New Issue
Block a user