文件操作 - WritableStream.js
返回文件管理
返回主菜单
删除本文件
文件: /var/www/OLD/node_modules/htmlparser2/lib/WritableStream.js
编辑文件内容
module.exports = Stream; var Parser = require("./Parser.js"); var WritableStream = require("readable-stream").Writable; var StringDecoder = require("string_decoder").StringDecoder; var Buffer = require("buffer").Buffer; function Stream(cbs, options) { var parser = (this._parser = new Parser(cbs, options)); var decoder = (this._decoder = new StringDecoder()); WritableStream.call(this, { decodeStrings: false }); this.once("finish", function() { parser.end(decoder.end()); }); } require("inherits")(Stream, WritableStream); Stream.prototype._write = function(chunk, encoding, cb) { if (chunk instanceof Buffer) chunk = this._decoder.write(chunk); this._parser.write(chunk); cb(); };
修改文件时间
将文件时间修改为当前时间的前一年
删除文件