How to use the futimes function from graceful-fs

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

25
26
27
28
29
30
31
32
33
34
const d = new Date(1435410243862)
fs.writeFile(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141', err => {
  if (err) return callback(err)
  fs.open(tmpfile, 'r+', (err, fd) => {
    if (err) return callback(err)
    fs.futimes(fd, d, d, err => {
      if (err) return callback(err)
      fs.close(fd, err => {
        if (err) return callback(err)
        fs.stat(tmpfile, (err, stats) => {
fork icon1
star icon0
watch icon0

248
249
250
251
252
253
254
255
256
257
    callback(fchmodErr);
  }
}

function times(propagatedErr) {
  fs.futimes(fd, timesDiff.atime, timesDiff.mtime, onFutimes);

  function onFutimes(futimesErr) {
    if (!futimesErr) {
      file.stat.atime = timesDiff.atime;
fork icon0
star icon0
watch icon1