获取文件的所有者和组使用boost [英] Get file's owner and group using boost
问题描述
我想使用boost ::文件系统从一个文件的所有者和组,但从来没有发现任何方式这样做。
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.
我找到了POSIX FSTAT功能,但同样我想使用升压或其他C ++库,而不是C函数。
I found the posix fstat function, but again I'd like to use boost or another C++ library rather than C functions.
推荐答案
什么你问做的是一个Unix系统调用。但是,你不想把它?为什么?什么可能值可能推动提供?这不是便携性,如无一个Unix之外将会有一个有意义的st_gid场。
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.
这篇关于获取文件的所有者和组使用boost的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!