本文整理汇总了C++中BEntry::GetGroup方法的典型用法代码示例。如果您正苦于以下问题:C++ BEntry::GetGroup方法的具体用法?C++ BEntry::GetGroup怎么用?C++ BEntry::GetGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BEntry
的用法示例。
在下文中一共展示了BEntry::GetGroup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: duplicates_exist
bool duplicates_exist (const char * signature)
{
BVolumeRoster roster;
BVolume volume;
BQuery query;
BString query_string = "BEOS:APP_SIG=";
BEntry entry;
mode_t permissions;
uid_t owner;
gid_t group;
int32 query_hits = 0;
query_string += signature;
while (roster.GetNextVolume(& volume) == B_OK)
{
if (volume.KnowsQuery())
{
PRINT(("volume.KnowsQuery()\n"));
char volname [B_FILE_NAME_LENGTH];
volume.GetName(volname);
PRINT(("volume: %s\n", volname));
query.Clear();
if (query.SetVolume(& volume) == B_OK)
{
PRINT(("query.SetVolume(& volume) == B_OK\n"));
if (query.SetPredicate(query_string.String()) == B_OK)
{
PRINT(("query.SetPredicate(%s) == B_OK\n", query_string.String()));
if (query.Fetch() == B_OK)
{
PRINT(("query.Fetch() == B_OK\n"));
while (query.GetNextEntry(& entry) == B_OK)
{
PRINT(("query.GetNextEntry(& entry) == B_OK\n"));
entry.GetPermissions(& permissions);
entry.GetOwner(& owner);
entry.GetGroup(& group);
BPath path (& entry);
// if (access(path.Path(), X_OK))
if (((owner == getuid()) && (permissions & S_IXUSR))
|| ((group == getgid()) && (permissions & S_IXGRP))
|| (permissions & S_IXOTH))
{
PRINT(("path is executable: %s\n", path.Path()));
query_hits++;
}
else
{
PRINT(("path is NOT executable: %s\n", path.Path()));
}
}
}
}
}
}
fflush(stdout);
}
if (query_hits > 1)
return true;
else
return false;
}