Method description:
Synchronous version of chown().
grammar:
The code copy is as follows:
fs.chownSync(path, uid, gid)
Since this method belongs to the fs module, it is necessary to introduce the fs module before use (var fs= require("fs") )
Receive parameters:
path directory path
uid user ID
gid group identity (refers to the identity of the user of the shared resource system)
example:
The code copy is as follows:
fs.chownSync('content.txt', uid, gid);
Source code:
The code copy is as follows:
fs.chownSync = function(path, uid, gid) {
nullCheck(path);
return binding.chown(pathModule._makeLong(path), uid, gid);
};