Example #1
0
			}, function() {
				fs.rmdir( tree[ "/" ], callback );
			} );
Example #2
0
			folderDone = function(err) {
			count++;
			if( count >= wait || err) {
				fs.rmdir(path,callback);
			}
		};
Example #3
0
 'test one directory' : function() {
     var path = './test2';
     fsutil.mkdir(path);
     assert(fs.existsSync(path));
     fs.rmdir(path);
 },
Example #4
0
function unlink(pathname) {
    try {
        fs.rmdir(pathname);
    } catch (e) {}
}
Example #5
0
 function (err) {
     if (err) return cb(err);
     fs.rmdir(currentFile, cb);
 });
Example #6
0
 complete = function () {
     if (--testFilesToDo === 0) {
         fs.rmdir(self.testFileDirectory, done);
     }
 };
Example #7
0
 fs.unlink('./tmp/_pouch_veryimportantfiles/something', function () {
   fs.rmdir('./tmp/_pouch_veryimportantfiles/', function () {
     done();
   });
 });
Example #8
0
ScopedFS.prototype.rmdir = function(path, callback) {
  return fs.rmdir(this.pathOf(path), callback);
};
Example #9
0
/*var crypto=require('crypto'),
	dns=require('dns');
var b1=new Buffer('1fsd郭df0');
console.log(b1);
var b2=Buffer.isBuffer(b1);
console.log(b2)
var b3=Buffer.isEncoding(b1,'utf8');
console.log('b3 :'+b3)
console.log(b1.length);
b1.write('999',0,b1.length);
console.log(b1.toString('hex'),b1.toJSON(),'qqq',b1.values());
console.log(dns.lookup('www.baidu.com'));*/
var fs=require('fs');
fs.rename('./wenzhanggeshi.txt','./文章格式.txt',function(err){
//console.log(err);
})
fs.rmdir('./dddd.s',function(err){
	//console.log(err)
})
fs.readdir('./tags',function(err,file){
	if(err) throw err;
	console.log(file);
});
var fd=fs.open('./dddd.s','w+');
var buffer=new Buffer(20);
fs.read(fd, buffer,function(err,bytesRead,buffer){
	console.log(bytesRead,buffer);
})
Example #10
0
 }, function () {
   fs.rmdir(dirpath, callback);
 });
Example #11
0
File: rmdir.js Project: tentou/Demo
/**
 * Created by zhangpeng on 2015/12/1.
 */
var fs = require("fs");

console.log("准备删除目录");
fs.rmdir("./test1/1",function(err){
    if (err) {
        return console.error(err);
    }
    console.log("读取 /tmp 目录");
    fs.readdir("./test1",function(err, files){
        if (err) {
            return console.error(err);
        }
        files.forEach( function (file){
            console.log( file );
        });
    });
});
Example #12
0
File: show.js Project: greg-js/wdn
 rm(path.resolve(customConfig, local), function() {
   rmdir(path.resolve(customConfig), function() {
     done();
   });
 });
Example #13
0
 rmdir(function(err) {
     if (err) return;
     fs.rmdir(path_, callback);
 });
Example #14
0
File: add.js Project: greg-js/wdn
 rm(path.resolve(customConfig, remote), function() {
   rmdir(path.resolve(customConfig), function() {
     done();
   });
 });
Example #15
0
		console.log(Date.now());
	}
});

console.log('========' + Date.now() + '==========');


fs.mkdirSync('t2');

console.log('========' + Date.now() + '==========');


// 删除文件夹

fs.rmdir('t1', function(){
	console.log('delete forder t1');
})

fs.rmdirSync('t2');

// 读取文件夹

if(fs.existsSync('t3')){
	var files = fs.readdirSync('t3');
	for(var i = 0; i < files.length; i++){
		fs.rmdirSync('t3/' + files[i]);
	}
	fs.rmdirSync('t3');
}

fs.mkdir('t3', function(err){
Example #16
0
commands.remove = function(){
    console.log('remove method not written');
    fs.rmdir(path, callback)
};
Example #17
0
	Future((reject, resolve) => {
		fs.rmdir(FOLDER_PATH, error => error ? reject(error) : resolve(FOLDER_PATH))
	})
Example #18
0
				directories.wait(function(item, next) {
					Fs.rmdir(item, () => next());
				}, () => callback());
Example #19
0
 res.on("end", function () {
   fs.rmdir(path, function (err) {
     done();
   });
 });
Example #20
0
fs.unlink(fn, common.mustCall((err) => {
  assert.ok(err.message.includes(fn));
}));

fs.rename(fn, 'foo', common.mustCall((err) => {
  assert.ok(err.message.includes(fn));
}));

fs.rename(existingDir, existingDir2, common.mustCall((err) => {
  assert.ok(err.message.includes(existingDir));
  assert.ok(err.message.includes(existingDir2));
}));

fs.rmdir(fn, common.mustCall((err) => {
  assert.ok(err.message.includes(fn));
}));

fs.mkdir(existingFile, 0o666, common.mustCall((err) => {
  assert.ok(err.message.includes(existingFile));
}));

fs.rmdir(existingFile, common.mustCall((err) => {
  assert.ok(err.message.includes(existingFile));
}));

fs.chmod(fn, 0o666, common.mustCall((err) => {
  assert.ok(err.message.includes(fn));
}));

fs.open(fn, 'r', 0o666, common.mustCall((err) => {
Example #21
0
 file.unlink(function () {
     fs.rmdir(path.join(__dirname, "tmp"), function () {
         done();
     });
 });
Example #22
0
 return new Promise((res, rej) => {
   node_fs.rmdir(path, (err) => {
     if (err) { rej(err); } else { res(); }
   });
 });
Example #23
0
 it("rmdir", () => {
     fs.rmdir(pathname1);
     assert.equal(fs.exists(pathname1), false);
 });
Example #24
0
			], function(err) {
				if (err) {
					return callback(err);
				}
				fs.rmdir(path, callback);
			});
Example #25
0
 folders.forEach((folder) => {
   if (fs.readdirSync(folder).length === 0) {
     fs.rmdir(folder)
   }
 })
Example #26
0
					], function(err) {
						if (err) {
							return callback(err);
						}
						fs.rmdir(source, callback);
					});
Example #27
0
Storage.prototype.rmdir = function(name, cb) {
	fs.rmdir(this.path + '/' + name, cb)
}
Example #28
0
		/* 删除当前目录 */
		function(callback){
			fs.rmdir(target, callback);
		}
Example #29
0
		this.queue.push((cb)=>{
			console.log('rmdir',file)
			fs.rmdir(file,(err)=>cb())
		})
Example #30
0
File: test.js Project: Preole/bbw
			after(function (done) {
				// remove the result directory
				fs.rmdir(process.cwd() + '/test/html/result/', done);
			});