douzhen9428
2017-01-23 15:55
浏览 205
已采纳

如何在golang的os.FileMode中设置gid和uid?

I want to set the uid and gid on files that are created by our golang application. It looks like the right place is use the os.FileMode. I am looking for an example of setting the permissions and uid and gid all in one step.

Setting the permissions looks pretty straightforward:

os.FileMode(hdr.Mode&0777)

But I am not sure how to also set the uid/gid on FileMode.

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题