欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

node.js中的fs.fchownSync方法使用說(shuō)明

 更新時(shí)間:2014年12月16日 10:23:20   投稿:junjie  
這篇文章主要介紹了node.js中的fs.fchownSync方法使用說(shuō)明,本文介紹了fs.fchownSync方法說(shuō)明、語(yǔ)法、接收參數(shù)、使用實(shí)例和實(shí)現(xiàn)源碼,需要的朋友可以參考下

方法說(shuō)明:

同步版的 fchown() 。

語(yǔ)法:

復(fù)制代碼 代碼如下:

fs.fchownSync(fd, uid, gid)

由于該方法屬于fs模塊,使用前需要引入fs模塊(var fs= require(“fs”) )

接收參數(shù):

fd              文件描述符

uid            用戶(hù)ID

gid            群體身份 (指共享資源系統(tǒng)使用者的身份)

例子:

復(fù)制代碼 代碼如下:

fs.open('content.txt', 'a', function (err, fd) {
 if (err) {
  throw err;
 }
 fs.fchownSync(fd, uid, gid);
 fs.close(fd, function () {
   console.log('Done');
 });
});

源碼:

復(fù)制代碼 代碼如下:

fs.fchownSync = function(fd, uid, gid) {
  return binding.fchown(fd, uid, gid);
};

相關(guān)文章

最新評(píng)論