How to use the lutimes function from fs

Find comprehensive JavaScript fs.lutimes code examples handpicked from public code repositorys.

98
99
100
101
102
103
104
105
106
107
// test async code paths
//
fs.utimes(pathType(tmpdir.path), atime, mtime, common.mustCall((err) => {
  expect_ok('utimes', tmpdir.path, err, atime, mtime);

  fs.lutimes(pathType(lpath), atime, mtime, common.mustCall((err) => {
    expect_ok('lutimes', lpath, err, atime, mtime, fs.lstatSync);

    fs.utimes(pathType('foobarbaz'), atime, mtime, common.mustCall((err) => {
      expect_errno('utimes', 'foobarbaz', err, 'ENOENT');
fork icon42
star icon19
watch icon0

122
123
124
125
126
127
128
129
130
131
132
}


function lutime() {
  const fs = require('fs');
  fs.writeFileSync('fs111.txt', '123', 'utf8');
  fs.lutimes('fs111.txt', 1, 1, () => {
    fs.unlinkSync('fs111.txt');
  });
}

fork icon0
star icon0
watch icon0

+ 2 other calls in file