fs-base.js |
|
---|---|
var Q = require('commonjs/q'), when = Q.when, Deferred = Q.Deferred,
Promise = Q.Promise;
var Permissions = require('./fs-permissions').Permissions
var FS = require('./fs');
var NYI = new Error('Not yet implemented')
exports.openRaw = function(path) {
var deferred = Deferred()
|
|
async operation |
deferred.reject(NYI)
return deferred.promise
}
/**
Renames the file named by the source operand to the destination path
named by the target operand
@param {String()} source
@param {String()} target
@returns {Promise}
*/
exports.move = function(source, target) {
source = String(source)
target = String(target)
var deferred = Deferred()
|
async operation |
deferred.reject(NYI)
return deferred.promise
}
/**
remove file from the specified path
@param {String()} path
@returns {Promise}
*/
exports.remove = function(path) {
path = String(path)
var deferred = Deferred()
|
async operation |
deferred.reject(NYI)
return deferred.promise
}
/**
Sets the modification and access times of files to the current time of
day. If the file doesn't exist, it is created with default permissions.
*/
exports.touch = function(path) {
path = String(path)
var deferred = Deferred()
|
async operation |
deferred.reject(NYI)
return deferred.promise
}
/**
create directory on the specified path with default permissions
@param {String()} path
@returns {Promise}
*/
exports.makeDirectory = function(path) {
path = String(path)
var deferred = Deferred()
|
async operation |
deferred.reject(NYI)
return deferred.promise
}
/**
remove directory from the specified path
@param {String()} path
@returns {Promise}
*/
exports.removeDirectory = function(path) {
path = String(path)
var deferred = Deferred()
|
async operation |
deferred.reject(NYI)
return deferred.promise
}
/* override with engine optimized verision if applicablle
FS.canonical = function() {
var deferred = Deferred()
//DIVIDER
deferred.reject(NYI)
return deferred.promise
};
*/
/**
Current working directory. Analog to `cwd`.
@returns {Promise}
@resolves {String}
*/
exports.workingDirectory = function() {
var deferred = Deferred()
|
async operation |
deferred.reject(NYI)
return deferred.promise
}
/**
Changes working directory. Analog to `cd`.
@param {String()} path
@returns {Promise}
*/
|
async operation |
exports.changeWorkingDirectory = function(path) {
path = String(path)
var deferred = Deferred()
|
todo check the argument |
deferred.reject(NYI)
return deferred.promise
}
/**
Gets owner user for the path
@param {String()} path
@returns {Promise}
@resolves {Number}
*/
exports.owner = function(path) {
path = String(path)
var deferred = Deferred()
|
async operation |
deferred.reject(NYI)
return deferred.promise
}
/**
Gets owner group for the path
@param {String()} path
@returns {Promise}
@resolves {Number}
*/
exports.group = function(path) {
path = String(path)
var deferred = Deferred()
|
async operation |
deferred.reject(NYI)
return deferred.promise
}
/**
Changes group
@param {String()} path
@param {String()} group
@returns {Promise}
*/
exports.changeGroup = function(path, group) {
path = String(path)
group = String(group)
var deferred = Deferred()
|
async operation |
deferred.reject(NYI)
return deferred.promise
}
/**
Gets permissions for the path
@param {String()} path
@returns {Promise}
@resolves {Permissions}
*/
exports.permissions = function(path) {
path = String(path)
var deferred = Deferred()
|
async operation |
deferred.reject(NYI)
return deferred.promise
}
/**
Changes permissions
@param {String()} path
@param {Permissions()} permissions
@returns {Deferred}
*/
exports.changePermissions = function(path, permissions) {
path = String(path)
permissions = Permissions(permissions)
var deferred = Deferred()
|
async operation |
deferred.reject(NYI)
return deferred.promise
}
/**
Creates a new symbolic link on a source path pointing to a target path.
@param {String()} source source path
@param {String()} target target path
@returns {Promise}
*/
exports.symbolicLink = function(source, target) {
source = String(source)
target = String(target)
var deferred = Deferred()
|
async operation |
deferred.reject(NYI)
return deferred.promise
}
/**
Creates a new hard link on a source path pointing to a target path.
@param {String()} source source path
@param {String()} target target path
@returns {Promise}
*/
exports.hardLink = function(source, target) {
source = String(source)
target = String(target)
var deferred = Deferred()
|
async operation |
deferred.reject(NYI)
return deferred.promise
}
/**
Get target of symbolic / hard link
@param {String()} path link path
@returns {Promise}
@resolves {String}
*/
exports.readLink = function(path) {
path = String(path)
var deferred = Deferred()
|
async operation |
deferred.reject(NYI)
return deferred.promise
}
/**
Checks path for existance
@param {String()} path
@returns {Promise}
@resolves {Boolean}
*/
exports.exists = function(path) {
path = String(path)
var deferred = Deferred()
|
async operation |
deferred.reject(NYI)
return deferred.promise
}
/**
Checks if path is a file
@param {String()}
@returns {Promise}
@resolves {Boolean}
*/
exports.isFile = function(path) {
path = String(path)
var deferred = Deferred()
|
async operation |
deferred.reject(NYI)
return deferred.promise
}
/**
Checks if path is a Directory
@param {String()}
@returns {Promise}
@resolves {Boolean}
*/
exports.isDirectory = function(path) {
path = String(path)
var deferred = Deferred()
|
async operation |
deferred.reject(NYI)
return deferred.promise
}
/**
Checks if path is a symbolic / hard link
@param {String()}
@returns {Promise}
@resolves {Boolean}
*/
exports.isLink = function(path) {
path = String(path)
var deferred = Deferred()
|
async operation |
deferred.reject(NYI)
return deferred.promise
}
exports.size = function(path) {
path = String(path)
var deferred = Deferred()
|
async operation |
deferred.reject(NYI)
return deferred.promise
}
exports.lastModified = function(path) {
path = String(path)
var deferred = Deferred()
|
async operation |
deferred.reject(NYI)
return deferred.promise
}
exports.list = function(path) {
path = String(path)
var deferred = Deferred()
|
async operation |
deferred.reject(NYI)
return deferred.promise
}
|
async operation |
undefined
|