本文整理匯總了TypeScript中fs-extra.write函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript write函數的具體用法?TypeScript write怎麽用?TypeScript write使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了write函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: writeLogFile
writeLogFile(msg: string) {
const now = new Date()
let entry = `[${now}] ${msg}\n`
let fd = fs.openSync(this.acLogfilePath, 'a')
// @ts-ignore
fs.write(fd, entry)
}
示例2: Buffer
fs.fchmod(fd, modeNum, errorCallback);
fs.fchmod(fd, modeStr, errorCallback);
fs.fchmodSync(fd, modeNum);
fs.fchmodSync(fd, modeStr);
fs.lchmod(path, modeStr, errorCallback);
fs.lchmod(path, modeNum, errorCallback);
fs.lchmodSync(path, modeNum);
fs.lchmodSync(path, modeStr);
fs.statSync(path);
fs.lstatSync(path);
fs.read(0, new Buffer(""), 0, 0, null).then(x => {
const a = x.buffer;
const b = x.bytesRead;
});
fs.write(0, new Buffer(""), 0, 0, null).then(x => {
const a = x.buffer;
const b = x.bytesWritten;
});
// $ExpectType Promise<void>
fs.writeFile("foo.txt", "i am foo", { encoding: "utf-8" });
// $ExpectType Promise<string>
fs.mkdtemp("foo");
fs.copyFile("src", "dest").then();
fs.copyFile("src", "dest", fs.constants.COPYFILE_EXCL).then();
fs.copyFile("src", "dest", errorCallback);