Method description:
Delete file directories asynchronously.
grammar:
The code copy is as follows:
fs.rmdir(path, [callback(err)])
Since this method belongs to the fs module, it is necessary to introduce the fs module before use (var fs= require("fs") )
Receive parameters:
path directory path
callback callback, the callback function passes an err exception parameter.
example:
The code copy is as follows:
var fs = require('fs');
fs.rmdir('deldir', function(err){
if(err){
console.log(err);
}else{
console.log("done");
}
});
Source code:
The code copy is as follows:
fs.rmdir = function(path, callback) {
callback = makeCallback(callback);
if (!nullCheck(path, callback)) return;
binding.rmdir(pathModule._makeLong(path), callback);
};