javascript - After rename zip file i could not delete folder in node.js -
i have renamed upload file using this
fs.rename('xxxxx','xxxxx',function(err) { });
after renamed within callback function have tried remove on folder not working ,i have tried this
fs.rename('xxxxx','xxxxx',function(err) { fs.rmdir('xxxx',function(err) { if(err) { console.log('error'); }else { console.log('removed'); } }); });
but getting err in console , files not removed.how resolve ?
you can not remove folder has files in it. need delete files in folder first.
there's no quick way delete whole tree in node.js. could, make little easier using node-file-utils. has walk
function traverse subdirectories of path. use delete files in path.
Comments
Post a Comment