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

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -