node.js中的fs.lchownSync方法使用说明
方法说明:
同步版的lchown()。
语法:
fs.lchownSync(path,uid,gid)
由于该方法属于fs模块,使用前需要引入fs模块(varfs=require(“fs”))
接收参数:
path 目录路径
uid 用户ID
gid 群体身份(指共享资源系统使用者的身份)
例子:
fs.lchownSync('content.txt',uid,gid);
源码:
fs.lchownSync=function(path,uid,gid){ varfd=fs.openSync(path,constants.O_WRONLY|constants.O_SYMLINK); returnfs.fchownSync(fd,uid,gid); };