我想删除list_file_to_delete
中的3个文件,但我不知道什么是“路径三个文件在这里”?我需要为环/中/的forEach功能删除所有或只需要3条路径可能var string = "...a1.jpg, ...a2.jpg,...a3.jpg"
一个字符串?在此先感谢文件路径和删除nodejs文件
在delete.js
文件
var list_file_to_delete = ["/images/a1.jpg", "/images/a2.jpg", "/images/a3.jpg"]
fs.unlink(path to three files here, function(err) {console.log("success")})
这是myapp
目录
myapp
/app
/js
delete.js
/public
/images
a1.jpg
a2.jpg
a3.jpg
server.js
反引号不是引号。使用它们仅环绕代码。 –