How to use the futimesSync function from graceful-fs

Find comprehensive JavaScript graceful-fs.futimesSync code examples handpicked from public code repositorys.

539
540
541
542
543
544
545
546
547
548
549
550


// utimes
exports.utimes = Promise.promisify(fs.utimes);
exports.utimesSync = fs.utimesSync;
exports.futimes = Promise.promisify(fs.futimes);
exports.futimesSync = fs.futimesSync;


// watch
exports.watch = watch;
exports.watchFile = fs.watchFile;
fork icon9
star icon48
watch icon0

+ 7 other calls in file

10
11
12
13
14
15
16
17
18
19
20


  // 550 millis past UNIX epoch
  const d = new Date(1435410243862)
  fs.writeFileSync(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141')
  const fd = fs.openSync(tmpfile, 'r+')
  fs.futimesSync(fd, d, d)
  fs.closeSync(fd)
  return fs.statSync(tmpfile).mtime > 1435410243000
}

fork icon1
star icon0
watch icon0

29
30
31
32
33
34
35
36
37
38
  fs.writeSync(fdw, _buff, 0, bytesRead)
  pos += bytesRead
}

if (preserveTimestamps) {
  fs.futimesSync(fdw, stat.atime, stat.mtime)
}

fs.closeSync(fdr)
fs.closeSync(fdw)
fork icon0
star icon0
watch icon0

63
64
65
66
67
68
69
70
71
72
73
74
  })
}


function utimesMillisSync (path, atime, mtime) {
  const fd = fs.openSync(path, 'r+')
  fs.futimesSync(fd, atime, mtime)
  return fs.closeSync(fd)
}


module.exports = {
fork icon0
star icon0
watch icon0

+ 5 other calls in file

86
87
88
89
90
91
92
93
94
95
96
97
    const bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos)
    fs.writeSync(fdw, _buff, 0, bytesRead)
    pos += bytesRead
  }


  if (opts.preserveTimestamps) fs.futimesSync(fdw, srcStat.atime, srcStat.mtime)


  fs.closeSync(fdr)
  fs.closeSync(fdw)
}
fork icon0
star icon0
watch icon0

+ 2 other calls in file

90
91
92
93
94
95
96
97
98
99
100
	}
};


exports.futimesSync = (fileDescriptor, atime, mtime, path) => {
	try {
		return fs.futimesSync(fileDescriptor, atime, mtime, path);
	} catch (error) {
		throw new CpFileError(`futimes \`${path}\` failed: ${error.message}`, error);
	}
};
fork icon0
star icon0
watch icon0

90
91
92
93
94
95
96
97
98
99
100
	}
};


exports.futimesSync = (fd, atime, mtime, path) => {
	try {
		return fs.futimesSync(fd, atime, mtime, path);
	} catch (err) {
		throw new CpFileError(`futimes \`${path}\` failed: ${err.message}`, err);
	}
};
fork icon0
star icon0
watch icon0