本文整理匯總了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);
}