Lines Matching refs:fs
25 function patch (fs) { argument
32 patchLchmod(fs)
36 if (!fs.lutimes) {
37 patchLutimes(fs)
45 fs.chown = chownFix(fs.chown)
46 fs.fchown = chownFix(fs.fchown)
47 fs.lchown = chownFix(fs.lchown)
49 fs.chmod = chmodFix(fs.chmod)
50 fs.fchmod = chmodFix(fs.fchmod)
51 fs.lchmod = chmodFix(fs.lchmod)
53 fs.chownSync = chownFixSync(fs.chownSync)
54 fs.fchownSync = chownFixSync(fs.fchownSync)
55 fs.lchownSync = chownFixSync(fs.lchownSync)
57 fs.chmodSync = chmodFixSync(fs.chmodSync)
58 fs.fchmodSync = chmodFixSync(fs.fchmodSync)
59 fs.lchmodSync = chmodFixSync(fs.lchmodSync)
61 fs.stat = statFix(fs.stat)
62 fs.fstat = statFix(fs.fstat)
63 fs.lstat = statFix(fs.lstat)
65 fs.statSync = statFixSync(fs.statSync)
66 fs.fstatSync = statFixSync(fs.fstatSync)
67 fs.lstatSync = statFixSync(fs.lstatSync)
70 if (!fs.lchmod) {
71 fs.lchmod = function (path, mode, cb) {
74 fs.lchmodSync = function () {}
76 if (!fs.lchown) {
77 fs.lchown = function (path, uid, gid, cb) {
80 fs.lchownSync = function () {}
93 fs.rename = (function (fs$rename) { return function (from, to, cb) {
101 fs.stat(to, function (stater, st) {
114 }})(fs.rename)
118 fs.read = (function (fs$read) {
126 return fs$read.call(fs, fd, buffer, offset, length, position, callback)
131 return fs$read.call(fs, fd, buffer, offset, length, position, callback)
137 })(fs.read)
139 fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) {
143 return fs$readSync.call(fs, fd, buffer, offset, length, position)
152 }})(fs.readSync)
154 function patchLchmod (fs) { argument
155 fs.lchmod = function (path, mode, callback) {
156 fs.open( path
166 fs.fchmod(fd, mode, function (err) {
167 fs.close(fd, function(err2) {
174 fs.lchmodSync = function (path, mode) {
175 var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)
182 ret = fs.fchmodSync(fd, mode)
187 fs.closeSync(fd)
190 fs.closeSync(fd)
197 function patchLutimes (fs) { argument
199 fs.lutimes = function (path, at, mt, cb) {
200 fs.open(path, constants.O_SYMLINK, function (er, fd) {
205 fs.futimes(fd, at, mt, function (er) {
206 fs.close(fd, function (er2) {
213 fs.lutimesSync = function (path, at, mt) {
214 var fd = fs.openSync(path, constants.O_SYMLINK)
218 ret = fs.futimesSync(fd, at, mt)
223 fs.closeSync(fd)
226 fs.closeSync(fd)
233 fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) }
234 fs.lutimesSync = function () {}
241 return orig.call(fs, target, mode, function (er) {
252 return orig.call(fs, target, mode)
263 return orig.call(fs, target, uid, gid, function (er) {
274 return orig.call(fs, target, uid, gid)
297 return options ? orig.call(fs, target, options, callback)
298 : orig.call(fs, target, callback)
307 var stats = options ? orig.call(fs, target, options)
308 : orig.call(fs, target)