Пример #1
0
pf_stat CacheBase::GetAttr(std::string path)
{
	BlockLockMutex lock(this);

	FileEntry* file = Path2File(path);
	if(!file)
		throw NoSuchFileOrDir();

	return file->GetAttr();
}
Пример #2
0
void CacheBase::ChMod(std::string path, mode_t mode)
{
	BlockLockMutex lock(this);

	FileEntry* file = Path2File(path);
	if(!file)
		throw NoSuchFileOrDir();

	pf_stat stat = file->GetAttr();
	stat.mode = mode;
	stat.meta_mtime = time(NULL);
	SetAttr(path, stat);
}
Пример #3
0
void CacheBase::ChOwn(std::string path, uid_t uid, gid_t gid)
{
	BlockLockMutex lock(this);

	FileEntry* file = Path2File(path);
	if(!file)
		throw NoSuchFileOrDir();

	pf_stat stat = file->GetAttr();
	stat.uid = uid;
	stat.gid = gid;
	stat.meta_mtime = time(NULL);
	SetAttr(path, stat);
}