From fab6393f65fec0aa56099690eb62c74c84b45e63 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 1 Mar 2022 10:00:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BA=86=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=AF=BB=E5=8F=96=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common.txt" | 1 + .../demo01.js" | 28 +++++++++++++++++++ ...0\344\270\252\346\226\207\344\273\266.txt" | 1 + ...1\344\270\252\346\226\207\344\273\266.txt" | 1 + ...2\344\270\252\346\226\207\344\273\266.txt" | 1 + ...3\344\270\252\346\226\207\344\273\266.txt" | 1 + ...4\344\270\252\346\226\207\344\273\266.txt" | 1 + ...5\344\270\252\346\226\207\344\273\266.txt" | 1 + ...6\344\270\252\346\226\207\344\273\266.txt" | 1 + ...7\344\270\252\346\226\207\344\273\266.txt" | 1 + ...8\344\270\252\346\226\207\344\273\266.txt" | 1 + ...9\344\270\252\346\226\207\344\273\266.txt" | 1 + 12 files changed, 39 insertions(+) create mode 100644 "\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/common.txt" create mode 100644 "\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/demo01.js" create mode 100644 "\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\25410\344\270\252\346\226\207\344\273\266.txt" create mode 100644 "\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2541\344\270\252\346\226\207\344\273\266.txt" create mode 100644 "\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2542\344\270\252\346\226\207\344\273\266.txt" create mode 100644 "\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2543\344\270\252\346\226\207\344\273\266.txt" create mode 100644 "\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2544\344\270\252\346\226\207\344\273\266.txt" create mode 100644 "\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2545\344\270\252\346\226\207\344\273\266.txt" create mode 100644 "\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2546\344\270\252\346\226\207\344\273\266.txt" create mode 100644 "\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2547\344\270\252\346\226\207\344\273\266.txt" create mode 100644 "\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2548\344\270\252\346\226\207\344\273\266.txt" create mode 100644 "\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2549\344\270\252\346\226\207\344\273\266.txt" diff --git "a/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/common.txt" "b/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/common.txt" new file mode 100644 index 0000000..d7ae5e6 --- /dev/null +++ "b/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/common.txt" @@ -0,0 +1 @@ +第1个第2个第3个第4个第5个第7个第6个第8个第9个第10个 \ No newline at end of file diff --git "a/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/demo01.js" "b/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/demo01.js" new file mode 100644 index 0000000..8fb60d6 --- /dev/null +++ "b/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/demo01.js" @@ -0,0 +1,28 @@ +let fs = require("fs"); + +fs.writeFile('./common.txt','',(err)=>{ + if(err) return console.log('写入失败'); + for (let i = 1; i <= 10; i++) { + fs.writeFile(`第${i}个文件.txt`, `第${i}个`, err => { + if (err) return console.log("写入文件失败", err); + let path=`./第${i}个文件.txt`; + console.log(path); + + fs.readFile(path,(err,data)=>{ + if(err){ + console.log("文件读取失败"); + }else{ + let str=data.toString(); + fs.appendFile('./common.txt',str,(err,data)=>{ + if(err){ + console.log('文件追加失败'); + }else{ + console.log('文件追加成功'); + } + }) + } + }) + + }) + } +}) diff --git "a/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\25410\344\270\252\346\226\207\344\273\266.txt" "b/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\25410\344\270\252\346\226\207\344\273\266.txt" new file mode 100644 index 0000000..56a9f6d --- /dev/null +++ "b/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\25410\344\270\252\346\226\207\344\273\266.txt" @@ -0,0 +1 @@ +第10个 \ No newline at end of file diff --git "a/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2541\344\270\252\346\226\207\344\273\266.txt" "b/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2541\344\270\252\346\226\207\344\273\266.txt" new file mode 100644 index 0000000..899a7f8 --- /dev/null +++ "b/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2541\344\270\252\346\226\207\344\273\266.txt" @@ -0,0 +1 @@ +第1个 \ No newline at end of file diff --git "a/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2542\344\270\252\346\226\207\344\273\266.txt" "b/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2542\344\270\252\346\226\207\344\273\266.txt" new file mode 100644 index 0000000..9c523d2 --- /dev/null +++ "b/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2542\344\270\252\346\226\207\344\273\266.txt" @@ -0,0 +1 @@ +第2个 \ No newline at end of file diff --git "a/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2543\344\270\252\346\226\207\344\273\266.txt" "b/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2543\344\270\252\346\226\207\344\273\266.txt" new file mode 100644 index 0000000..192bbc8 --- /dev/null +++ "b/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2543\344\270\252\346\226\207\344\273\266.txt" @@ -0,0 +1 @@ +第3个 \ No newline at end of file diff --git "a/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2544\344\270\252\346\226\207\344\273\266.txt" "b/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2544\344\270\252\346\226\207\344\273\266.txt" new file mode 100644 index 0000000..174202b --- /dev/null +++ "b/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2544\344\270\252\346\226\207\344\273\266.txt" @@ -0,0 +1 @@ +第4个 \ No newline at end of file diff --git "a/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2545\344\270\252\346\226\207\344\273\266.txt" "b/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2545\344\270\252\346\226\207\344\273\266.txt" new file mode 100644 index 0000000..4cfd900 --- /dev/null +++ "b/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2545\344\270\252\346\226\207\344\273\266.txt" @@ -0,0 +1 @@ +第5个 \ No newline at end of file diff --git "a/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2546\344\270\252\346\226\207\344\273\266.txt" "b/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2546\344\270\252\346\226\207\344\273\266.txt" new file mode 100644 index 0000000..8c1cb50 --- /dev/null +++ "b/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2546\344\270\252\346\226\207\344\273\266.txt" @@ -0,0 +1 @@ +第6个 \ No newline at end of file diff --git "a/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2547\344\270\252\346\226\207\344\273\266.txt" "b/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2547\344\270\252\346\226\207\344\273\266.txt" new file mode 100644 index 0000000..792e4f2 --- /dev/null +++ "b/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2547\344\270\252\346\226\207\344\273\266.txt" @@ -0,0 +1 @@ +第7个 \ No newline at end of file diff --git "a/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2548\344\270\252\346\226\207\344\273\266.txt" "b/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2548\344\270\252\346\226\207\344\273\266.txt" new file mode 100644 index 0000000..370522b --- /dev/null +++ "b/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2548\344\270\252\346\226\207\344\273\266.txt" @@ -0,0 +1 @@ +第8个 \ No newline at end of file diff --git "a/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2549\344\270\252\346\226\207\344\273\266.txt" "b/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2549\344\270\252\346\226\207\344\273\266.txt" new file mode 100644 index 0000000..d53694d --- /dev/null +++ "b/\345\273\226\346\226\207\346\235\260/\346\226\207\344\273\266\350\257\273\345\217\226\344\275\234\344\270\232/\347\254\2549\344\270\252\346\226\207\344\273\266.txt" @@ -0,0 +1 @@ +第9个 \ No newline at end of file -- Gitee