Esempio n. 1
0
bool
Model::StatChanged()
{
	ASSERT(IsNodeOpen());
	mode_t oldMode = fStatBuf.st_mode;
	fStatus = fNode->GetStat(&fStatBuf);

	if (oldMode != fStatBuf.st_mode) {
		bool forWriting = IsNodeOpenForWriting();
		CloseNode();
		//SetupBaseType();
			// the node type can't change with a stat update...
		OpenNodeCommon(forWriting);
		return true;
	}

	return false;
}
Esempio n. 2
0
status_t 
Model::UpdateStatAndOpenNode(bool writable)
{
	if (IsNodeOpen() && (writable == IsNodeOpenForWriting()))
		return B_OK;
	
	// try reading the stat structure again
	BEntry tmpEntry(&fEntryRef);
	fStatus = tmpEntry.InitCheck();
	if (fStatus != B_OK)
		return fStatus;
	
	fStatus = tmpEntry.GetStat(&fStatBuf);
	if (fStatus != B_OK)
		return fStatus;

	OpenNodeCommon(writable);
	return fStatus;
}