方法说明:
同步版的 fchown() 。
语法:
fs.fchownSync(fd, uid, gid)
由于该方法属于fs模块,使用前需要引入fs模块(var fs= require(“fs”) )
接收参数:
fd 文件描述符
uid 用户ID
gid 群体身份 (指共享资源系统使用者的身份)
例子:
fs.open('content.txt', 'a', function (err, fd) {
if (err) {
throw err;
}
fs.fchownSync(fd, uid, gid);
fs.close(fd, function () {
console.log('Done');
});
});
源码:
fs.fchownSync = function(fd, uid, gid) {
return binding.fchown(fd, uid, gid);
};
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn