本文整理汇总了TypeScript中fs.rmdir函数的典型用法代码示例。如果您正苦于以下问题:TypeScript rmdir函数的具体用法?TypeScript rmdir怎么用?TypeScript rmdir使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rmdir函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: reject
return new Promise<void>((resolve, reject) => {
fs.rmdir(dirPath, (err: any) => {
if (err) {
reject(err);
} else {
resolve();
}
});
});
示例2: cleandir
cleandir(dir, files, 0, (err) => {
if (err) {
cb(err);
return;
}
fs.rmdir(dir, (err) => {
if (err) {
cb(err);
} else {
cb(null);
}
});
});
示例3: main
function main(): void {
'use strict';
let pathToScript = process.argv[1];
let args = process.argv.slice(2);
/*if (args.length && args[0] === '-n') {
trailingNewline = false;
args = args.slice(1);
}*/
let code = 0;
fs.rmdir(args[0], () => {
process.exit(code);
});
}
示例4: function
var checkStatus = function () {
// We check the status
// and count till we r done
if (f_length === f_delete_index) {
fs.rmdir(path, function (err: any) {
if (err) {
cb(err, null);
} else {
cb(null, true);
}
});
return true;
}
return false;
};
示例5: function
fs.readdir(dir, function (err, files): void {
console.log("dir: " + dir);
let filename: string;
for (let i = 0; i < files.length; i++) {
filename = path.join(dir, files[i]);
console.log(filename);
fs.stat(dir, function(oerr: any, stats: fs.Stats): void {
console.log(filename + " !isFile: " + !stats.isFile());
if (filename === "." || filename === "..") {
// pass these files
console.log(".");
} else if (!stats.isFile()) {
// rmdir recursively
console.log("recurse on dir: " + filename);
frmdir(filename);
} else {
// rm fiilename
console.log("removing file: " + filename);
fs.unlink(filename);
}
});
}
fs.rmdir(dir);
});
示例6: after
after('delete empty tree', callback =>
rmdir(this.empty_dir, callback)
示例7:
await mio.promise(callback => fs.rmdir(fileOrFolderPath, callback));
示例8: cb
(cb) => { fs.rmdir(path.join(server.projectPath, "resources/arcadePhysics2DSettings"), (err) => { cb(); }); },
示例9:
Fs.unlink(lfsProgressPath, err => {
if (err == null) {
const directory = Path.dirname(lfsProgressPath)
Fs.rmdir(directory, () => {})
}
})
示例10: onSubCompleted
function onSubCompleted() {
__fs.rmdir(path, cb);
}