啊啊啊啊啊啊啊啊啊啊啊啊啊啊,被node的fs坑了一下午,我又爬上来了,要坚强的笑着活下去,嗯,没毛病老铁. let http = require('http'); let fs = require('fs'); let url = require('url'); let server = http.createServer((request,response)=>{ var pathname = url.parse('http://127.0.0.1:3000/ceshi.html',true…
//10个数 10个字节,每次读4b,写1b let fs=require("fs"); function pipe(source,target) { //先创建可读流,再创建可写流 //先读一次,rs.on(data) //将读到的类容写入目标中 ,返回布尔值,如果是ture,继续写,默认情况应该是false,暂停读取 //ws.on('drain'),抽干后,回复读取 //监听读取文件完毕后,关闭读取rs.on('end') let rs=fs.createReadStream(s…