Get file's owner and group using boost

爱⌒轻易说出口 提交于 2019-12-19 21:35:57

问题


I want to get the owner and group from a file using boost::filesystem, but never found any way to do so.

I can get the file's permissions, but as I don't know the file's owner this just doesn't mean anything.

I found the posix fstat function, but again I'd like to use boost or another C++ library rather than C functions.


回答1:


What you're asking to do is a Unix system call. But you don't want to call it? Why? What possible value could boost provide? It's not portability, as nothing outside of a Unix is going to have a meaningful st_gid field.



来源:https://stackoverflow.com/questions/10289491/get-files-owner-and-group-using-boost

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!