How to use the chownSync function from fs-extra

Find comprehensive JavaScript fs-extra.chownSync code examples handpicked from public code repositorys.

144
145
146
147
148
149
150
151
152
            stream.write({rx: data.length / meta.size});
        });

        stream.on('end', function () {
            Logger.verbose(Util.format('Updating file perms for %s (changing to %s:%s)', file.path, server.config.user, server.config.user));
            Fs.chownSync(file.path, Userid.uid(server.config.user), Userid.gid(server.config.user));
        });
    });
});
fork icon11
star icon17
watch icon0

59
60
61
62
63
64
65
66
67
68
        fs.copySync(source, output)
    }
    fs.chmodSync(output, stat.mode)


    if (options.preserve) {
        fs.chownSync(output, stat.uid, stat.gid)
        fs.utimesSync(output, stat.atime, stat.mtime)
    }
}
fork icon3
star icon28
watch icon0

147
148
149
150
151
152
153
154
155
156
157
      return path + '/' + element;
    }, '');
    // Set full path permissions
    fs.chownSync(targetDir, userId, groupId);
    // Set node keyfile permissions
    fs.chownSync(`${targetDir}/${fileName}`, userId, groupId);
  }
};


module.exports = {
fork icon3
star icon12
watch icon0

+ 5 other calls in file

126
127
128
129
130
131
132
133
134
135
}
if (data.hasOwnProperty('uid') && data.hasOwnProperty('gid')) {
  logdebug('Setting UID ' + data.uid + ', GID ' + data.gid + ' for ' + path);
  fs.lchownSync(path, data.uid, data.gid);
  if (followSymlink) {
    fs.chownSync(realpath, data.uid, data.gid);
  }
}
// Linux does not have lchmod, so we have to make sure the target exists
if (!stats.isSymbolicLink() || followSymlink) {
fork icon0
star icon1
watch icon2

function icon

fs-extra.readFileSync is the most popular function in fs-extra (9724 examples)