方法说明:
同步版本的 rmdir() 。
返回值为null 或 undefined则表示删除成功,否则将抛出异常。
语法:
fs.rmdirSync(path)
由于该方法属于fs模块,使用前需要引入fs模块(var fs= require(“fs”) )
接收参数:
path 目录路径
例子:
var fs = require('fs');
var deldir = fs.rmdirSync('deldir');
console.log(deldir);
源码:
fs.rmdirSync = function(path) {
nullCheck(path);
return binding.rmdir(pathModule._makeLong(path));
};
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn