Update file.js

This commit is contained in:
Namhyeon Go 2023-09-21 18:55:35 +09:00 committed by GitHub
parent 2d72f6a87b
commit c4ccdaf1aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,9 +54,14 @@ function fileGet(FN) {
/////////////////////////////////////////////////////////////////////////////////
function readFile(FN, charset) {
var pipe = PipeIPC.create();
var text = '';
var pipe = PipeIPC.connect("volatile");
pipe.setCharset(charset);
return pipe.readTextFromFile(FN);
pipe.loadFromFile(FN);
text += pipe.read();
pipe.destroy();
return text;
}
/////////////////////////////////////////////////////////////////////////////////
@ -175,6 +180,6 @@ exports.includeFile = includeFile;
exports.appendFile = appendFile;
exports.rotateFile = rotateFile;
exports.VERSIONINFO = "File Library (file.js) version 0.2.5";
exports.VERSIONINFO = "File Library (file.js) version 0.2.6";
exports.global = global;
exports.require = global.require;