Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
fs.lstatSync = function(path) {
nullCheck(path);
return binding.lstat(pathModule._makeLong(path));
};
fs.symlink = function(destination, path, type_, callback) {
var type = (util.isString(type_) ? type_ : null);
var callback = makeCallback(arguments[arguments.length - 1]);
return callback(new Error('TODO-CODIUS: Not implemented!'));
if (!nullCheck(destination, callback)) return;
if (!nullCheck(path, callback)) return;
binding.symlink(preprocessSymlinkDestination(destination, type),
pathModule._makeLong(path),
type,
callback);
};
fs.chownSync = function(path, uid, gid) {
nullCheck(path);
return binding.chown(pathModule._makeLong(path), uid, gid);
};
function readPackage(requestPath) {
if (hasOwnProperty(packageMainCache, requestPath)) {
return packageMainCache[requestPath];
}
const jsonPath = (-1 === requestPath.indexOf('__enclose_io_memfs__')) ?
path.resolve(requestPath, 'package.json') :
path.join(requestPath, 'package.json');
const json = (-1 === requestPath.indexOf('__enclose_io_memfs__')) ?
internalModuleReadFile(path._makeLong(jsonPath)) :
process.binding('natives').__enclose_io_memfs_get__(jsonPath);
if (json === undefined) {
return false;
}
try {
var pkg = packageMainCache[requestPath] = JSON.parse(json).main;
} catch (e) {
e.path = jsonPath;
e.message = 'Error parsing ' + jsonPath + ': ' + e.message;
throw e;
}
return pkg;
}
function stat(filename) {
filename = path._makeLong(filename);
const cache = stat.cache;
if (cache !== null) {
const result = cache.get(filename);
if (result !== undefined) return result;
}
const result = internalModuleStat(filename);
if (cache !== null) cache.set(filename, result);
return result;
}
stat.cache = null;
fs.accessSync = function(path, mode) {
nullCheck(path);
if (mode === undefined)
mode = fs.F_OK;
else
mode = mode | 0;
binding.access(pathModule._makeLong(path), mode);
};
fs.symlinkSync = function(target, path, type) {
type = (typeof type === 'string' ? type : null);
nullCheck(target);
nullCheck(path);
return binding.symlink(preprocessSymlinkDestination(target, type, path),
pathModule._makeLong(path),
type);
};
function makeLong (f) {
return require('path')._makeLong(f);
}
fs.renameSync = function(oldPath, newPath) {
nullCheck(oldPath);
nullCheck(newPath);
return binding.rename(pathModule._makeLong(oldPath),
pathModule._makeLong(newPath));
};
fs.chown = function(path, uid, gid, callback) {
callback = makeCallback(callback);
if (!nullCheck(path, callback)) return;
binding.chown(pathModule._makeLong(path), uid, gid, callback);
};