appendFile 的同步版本,向文件追加内容。
appendFile
文件路径。
要追加的内容。
追加成功返回的操作结果。
const result = appendFileSync('/path/to/file.txt', '\nNew content');if (result.isOk()) { console.log('追加成功');} Copy
const result = appendFileSync('/path/to/file.txt', '\nNew content');if (result.isOk()) { console.log('追加成功');}
appendFile的同步版本,向文件追加内容。