Beispiel #1
0
		var func = function(s,e){
			path = normalize(path);
			return deep.async(fs, "unlink", [path])
			.done(function(sc){
				return s;
			});
		};
Beispiel #2
0
		var func = function(s,e){
			path = normalize(path);
			return deep.async(fs, "mkdir", [path, mode])
			.done(function(sc){
				return s;
			});
		};
Beispiel #3
0
		var func = function(s,e){
			path = normalize(path);
			return deep.async(fs, "chown", [path, uid, gid])
			.done(function(sc){
				return s || sc;
			});
		};
Beispiel #4
0
		var func = function(s,e){
			srcpath = normalize(srcpath);
			dstpath = normalize(dstpath);
			return deep.async(fs, "link", [srcpath, dstpath])
			.done(function(sc){
				return s;
			});
		};
Beispiel #5
0
		var func = function(s,e){
			oldPath = normalize(oldPath);
			newPath = normalize(newPath);
			return deep.async(fs, "rename", [oldPath, newPath])
			.done(function(sc){
				return s || sc;
			});
		};
Beispiel #6
0
		var func = function(s,e){
			data = (typeof data === 'undefined')?s:data;
			data = deep.nodes.val(data);
			path = normalize(path);
			return deep.async(fs, "appendFile", [path, "\r\n"+data, options])
			.done(function(){
				return data;
			});
		};
Beispiel #7
0
		var func = function(s,e){
			data = (typeof data === 'undefined')?s:data;
			data = deep.nodes.val(data);
			path = normalize(path);
			if(!(data instanceof Buffer) && typeof data !== 'string')
				data = JSON.stringify(data, null, (minified?null:' '));
			return deep.async(fs, "writeFile", [path, data])
			.done(function(){
				return data;
			});
		};
Beispiel #8
0
		var func = function(s,e){
			path = normalize(path);
			return deep.async(fs, "readFile", [path, options])
			.done(function(s){
				switch(options.type)
				{
					case 'binary': return s; break;
					case 'json': return JSON.parse(String(s)); break;
					default : return String(s);
				}
			});
		};
Beispiel #9
0
		var func = function(s,e){
			path = normalize(path);
			return deep.async(fs, "readdir", [path]);
		};
Beispiel #10
0
		var func = function(s,e){
			path = path || s;
			path = normalize(path);
			return deep.async(fs, "stat", [path]);
		};