本文整理汇总了C++中BVolume::GetRootDirectory方法的典型用法代码示例。如果您正苦于以下问题:C++ BVolume::GetRootDirectory方法的具体用法?C++ BVolume::GetRootDirectory怎么用?C++ BVolume::GetRootDirectory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BVolume
的用法示例。
在下文中一共展示了BVolume::GetRootDirectory方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
static char *getMountPoint(const char *devname, char *buf, size_t bufsize)
{
BVolumeRoster mounts;
BVolume vol;
mounts.Rewind();
while (mounts.GetNextVolume(&vol) == B_NO_ERROR)
{
fs_info fsinfo;
fs_stat_dev(vol.Device(), &fsinfo);
if (strcmp(devname, fsinfo.device_name) == 0)
{
BDirectory directory;
BEntry entry;
BPath path;
const char *str;
if ( (vol.GetRootDirectory(&directory) < B_OK) ||
(directory.GetEntry(&entry) < B_OK) ||
(entry.GetPath(&path) < B_OK) ||
( (str = path.Path()) == NULL) )
return NULL;
strncpy(buf, str, bufsize-1);
buf[bufsize-1] = '\0';
return buf;
} /* if */
} /* while */
return NULL;
} /* getMountPoint */
示例2:
void
TTracker::Pulse()
{
if (!TrackerSettings().ShowVolumeSpaceBar())
return;
// update the volume icon's free space bars
BVolumeRoster roster;
BVolume volume;
while (roster.GetNextVolume(&volume) == B_NO_ERROR)
{
BDirectory dir;
volume.GetRootDirectory(&dir);
node_ref nodeRef;
dir.GetNodeRef(&nodeRef);
BMessage notificationMessage;
notificationMessage.AddInt32("device", *(int32 *)&nodeRef.device);
LockLooper();
SendNotices(kUpdateVolumeSpaceBar, ¬ificationMessage);
UnlockLooper();
}
}
示例3: next
inline bool QStorageIterator::next()
{
BVolume volume;
if (m_volumeRoster.GetNextVolume(&volume) != B_OK)
return false;
BDirectory directory;
if (volume.GetRootDirectory(&directory) != B_OK)
return false;
const BPath path(&directory);
fs_info fsInfo;
memset(&fsInfo, 0, sizeof(fsInfo));
if (fs_stat_dev(volume.Device(), &fsInfo) != 0)
return false;
m_rootPath = path.Path();
m_fileSystemType = QByteArray(fsInfo.fsh_name);
const QByteArray deviceName(fsInfo.device_name);
m_device = (deviceName.isEmpty() ? QByteArray::number(qint32(volume.Device())) : deviceName);
return true;
}
示例4: while
static char *getMountPoint(const char *devname)
{
BVolumeRoster mounts;
BVolume vol;
mounts.Rewind();
while (mounts.GetNextVolume(&vol) == B_NO_ERROR)
{
fs_info fsinfo;
fs_stat_dev(vol.Device(), &fsinfo);
if (strcmp(devname, fsinfo.device_name) == 0)
{
//char buf[B_FILE_NAME_LENGTH];
BDirectory directory;
BEntry entry;
BPath path;
status_t rc;
rc = vol.GetRootDirectory(&directory);
BAIL_IF_MACRO(rc < B_OK, strerror(rc), NULL);
rc = directory.GetEntry(&entry);
BAIL_IF_MACRO(rc < B_OK, strerror(rc), NULL);
rc = entry.GetPath(&path);
BAIL_IF_MACRO(rc < B_OK, strerror(rc), NULL);
const char *str = path.Path();
BAIL_IF_MACRO(str == NULL, ERR_OS_ERROR, NULL); /* ?! */
char *retval = (char *) allocator.Malloc(strlen(str) + 1);
BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, NULL);
strcpy(retval, str);
return(retval);
} /* if */
} /* while */
return(NULL);
} /* getMountPoint */
示例5: ReadDisks
void PanelView::ReadDisks(void)
////////////////////////////////////////////////////////////////////////
{
char drivename[256];
char drivepath[256];
// SetMousePointer(CR_HOURGLASS);
MAINWINDOW->SetMousePointer(GenesisWindow::CR_HOURGLASS);
CustomListItem *item;
item = new CustomListItem("..",m_Path.String(),FT_DISKBACK, 0);
item->AddIcon(m_ParentIcon);
m_CustomListView->AddItem(item);
item->SetHeight(15.0f);
// Collect available volumes...
BVolumeRoster *vr = new BVolumeRoster();
if (vr)
{
BVolume v;
while (vr->GetNextVolume(&v)==B_NO_ERROR)
{
if (v.GetName(drivename)==B_NO_ERROR)
{
if (strlen(drivename)>0)
{
BDirectory dir;
BEntry entry;
BPath path;
v.GetRootDirectory(&dir);
dir.GetEntry(&entry);
entry.GetPath(&path);
sprintf(drivepath,"%s",path.Path());
item = new CustomListItem(drivename,drivepath,FT_DISKITEM,v.FreeBytes(),v.Capacity(),v.Device());
m_CustomListView->AddItem(item);
if (m_Setting_ShowIcons)
{
if (!item->GetIcon(&v))
item->AddIcon(m_UnknownIcon);
item->SetHeight(15.0f);
}
}
}
}
delete vr;
}
m_CustomListView->DoSortList();
m_CustomListView->Select(0,false);
// SetMousePointer(CR_DEFAULT);
MAINWINDOW->SetMousePointer(GenesisWindow::CR_DEFAULT);
}
示例6: mountPointPath
/*! \brief Returns the mount point for the partition.
If the partition is mounted this is the actual mount point. If it is not
mounted, but contains a file system, derived from the partition name
the name for a not yet existing directory in the root directory is
constructed and the path to it returned.
For partitions not containing a file system the method returns an error.
\param mountPoint Pointer to the path to be set to refer the mount point
(respectively potential mount point) of the partition.
\return \c B_OK, if everything went fine, an error code otherwise.
*/
status_t
BPartition::GetMountPoint(BPath* mountPoint) const
{
if (!mountPoint || !ContainsFileSystem())
return B_BAD_VALUE;
// if the partition is mounted, return the actual mount point
BVolume volume;
if (GetVolume(&volume) == B_OK) {
BDirectory dir;
status_t error = volume.GetRootDirectory(&dir);
if (error == B_OK)
error = mountPoint->SetTo(&dir, NULL);
return error;
}
// partition not mounted
// get the volume name
const char* volumeName = ContentName();
if (!volumeName || strlen(volumeName) == 0)
volumeName = Name();
if (!volumeName || strlen(volumeName) == 0)
volumeName = "unnamed volume";
// construct a path name from the volume name
// replace '/'s and prepend a '/'
BString mountPointPath(volumeName);
mountPointPath.ReplaceAll('/', '-');
mountPointPath.Insert("/", 0);
// make the name unique
BString basePath(mountPointPath);
int counter = 1;
while (true) {
BEntry entry;
status_t error = entry.SetTo(mountPointPath.String());
if (error != B_OK)
return error;
if (!entry.Exists())
break;
mountPointPath = basePath;
mountPointPath << counter;
counter++;
}
return mountPoint->SetTo(mountPointPath.String());
}
示例7: model
void
BSlowContextMenu::AddRootItemsIfNeeded()
{
BVolumeRoster roster;
roster.Rewind();
BVolume volume;
while (roster.GetNextVolume(&volume) == B_OK) {
BDirectory root;
BEntry entry;
if (!volume.IsPersistent()
|| volume.GetRootDirectory(&root) != B_OK
|| root.GetEntry(&entry) != B_OK)
continue;
Model model(&entry);
AddOneItem(&model);
}
}
示例8: Model
void
BSlowContextMenu::BuildVolumeMenu()
{
BVolumeRoster roster;
BVolume volume;
roster.Rewind();
while (roster.GetNextVolume(&volume) == B_OK) {
if (!volume.IsPersistent())
continue;
BDirectory startDir;
if (volume.GetRootDirectory(&startDir) == B_OK) {
BEntry entry;
startDir.GetEntry(&entry);
Model *model = new Model(&entry);
if (model->InitCheck() != B_OK) {
delete model;
continue;
}
BNavMenu *menu = new BNavMenu(model->Name(), fMessage.what,
fMessenger, fParentWindow, fTypesList);
menu->SetNavDir(model->EntryRef());
menu->InitTrackingHook(fTrackingHook.fTrackingHook, &(fTrackingHook.fTarget),
fTrackingHook.fDragMessage);
ASSERT(menu->Name());
ModelMenuItem *item = new ModelMenuItem(model, menu);
BMessage *message = new BMessage(fMessage);
message->AddRef("refs", model->EntryRef());
item->SetMessage(message);
fItemList->AddItem(item);
ASSERT(item->Label());
}
}
}
示例9: BMessage
status_t
PackageView::_InstallTypeChanged(int32 index)
{
if (index < 0)
return B_ERROR;
// Clear the choice list
for (int32 i = fDestination->CountItems() - 1; i >= 0; i--) {
BMenuItem* item = fDestination->RemoveItem(i);
delete item;
}
fCurrentType = index;
pkg_profile* profile = fInfo.GetProfile(index);
if (profile == NULL)
return B_ERROR;
BString typeDescription = profile->description;
if (typeDescription.IsEmpty())
typeDescription = profile->name;
fInstallTypeDescriptionView->SetText(typeDescription.String());
BPath path;
BVolume volume;
if (profile->path_type == P_INSTALL_PATH) {
BMenuItem* item = NULL;
if (find_directory(B_SYSTEM_NONPACKAGED_DIRECTORY, &path) == B_OK) {
dev_t device = dev_for_path(path.Path());
if (volume.SetTo(device) == B_OK && !volume.IsReadOnly()
&& path.Append("apps") == B_OK) {
item = _AddDestinationMenuItem(path.Path(), volume.FreeBytes(),
path.Path());
}
}
if (item != NULL) {
item->SetMarked(true);
fCurrentPath.SetTo(path.Path());
fDestination->AddSeparatorItem();
}
_AddMenuItem(B_TRANSLATE("Other" B_UTF8_ELLIPSIS),
new BMessage(P_MSG_OPEN_PANEL), fDestination);
fDestField->SetEnabled(true);
} else if (profile->path_type == P_USER_PATH) {
bool defaultPathSet = false;
BVolumeRoster roster;
while (roster.GetNextVolume(&volume) != B_BAD_VALUE) {
BDirectory mountPoint;
if (volume.IsReadOnly() || !volume.IsPersistent()
|| volume.GetRootDirectory(&mountPoint) != B_OK) {
continue;
}
if (path.SetTo(&mountPoint, NULL) != B_OK)
continue;
char volumeName[B_FILE_NAME_LENGTH];
volume.GetName(volumeName);
BMenuItem* item = _AddDestinationMenuItem(volumeName,
volume.FreeBytes(), path.Path());
// The first volume becomes the default element
if (!defaultPathSet) {
item->SetMarked(true);
fCurrentPath.SetTo(path.Path());
defaultPathSet = true;
}
}
fDestField->SetEnabled(true);
} else
fDestField->SetEnabled(false);
return B_OK;
}
示例10: ExtractQueryVolumes
status_t ExtractQueryVolumes(BNode *node, vollist *volumes) {
int32 length = 0;
char *attr = ReadAttribute(*node, kTrackerQueryVolume, &length);
BVolumeRoster roster;
if (attr == NULL) {
roster.Rewind();
BVolume vol;
while (roster.GetNextVolume(&vol) == B_NO_ERROR) {
if ((vol.IsPersistent() == true) && (vol.KnowsQuery() == true)) {
volumes->push_back(vol);
};
};
} else {
BMessage msg;
msg.Unflatten(attr);
// !*YOINK*!d from that project... with the funny little doggie as a logo...
// OpenTracker, that's it!
time_t created;
off_t capacity;
for (int32 index = 0; msg.FindInt32("creationDate", index, &created) == B_OK;
index++) {
if ((msg.FindInt32("creationDate", index, &created) != B_OK)
|| (msg.FindInt64("capacity", index, &capacity) != B_OK))
return B_ERROR;
BVolume volume;
BString deviceName = "";
BString volumeName = "";
BString fshName = "";
if (msg.FindString("deviceName", &deviceName) == B_OK
&& msg.FindString("volumeName", &volumeName) == B_OK
&& msg.FindString("fshName", &fshName) == B_OK) {
// New style volume identifiers: We have a couple of characteristics,
// and compute a score from them. The volume with the greatest score
// (if over a certain threshold) is the one we're looking for. We
// pick the first volume, in case there is more than one with the
// same score.
int foundScore = -1;
roster.Rewind();
char name[B_FILE_NAME_LENGTH];
while (roster.GetNextVolume(&volume) == B_OK) {
if (volume.IsPersistent() && volume.KnowsQuery()) {
// get creation time and fs_info
BDirectory root;
volume.GetRootDirectory(&root);
time_t cmpCreated;
fs_info info;
if (root.GetCreationTime(&cmpCreated) == B_OK
&& fs_stat_dev(volume.Device(), &info) == 0) {
// compute the score
int score = 0;
// creation time
if (created == cmpCreated)
score += 5;
// capacity
if (capacity == volume.Capacity())
score += 4;
// device name
if (deviceName == info.device_name)
score += 3;
// volume name
if (volumeName == info.volume_name)
score += 2;
// fsh name
if (fshName == info.fsh_name)
score += 1;
// check score
if (score >= 9 && score > foundScore) {
volume.GetName(name);
volumes->push_back(volume);
}
}
}
}
} else {
// Old style volume identifiers: We have only creation time and
// capacity. Both must match.
roster.Rewind();
while (roster.GetNextVolume(&volume) == B_OK)
if (volume.IsPersistent() && volume.KnowsQuery()) {
BDirectory root;
volume.GetRootDirectory(&root);
time_t cmpCreated;
root.GetCreationTime(&cmpCreated);
if (created == cmpCreated && capacity == volume.Capacity()) {
volumes->push_back(volume);
}
}
}
//.........这里部分代码省略.........
示例11: strlen
int
getmntent_haiku(int* cookie, struct mnttab* mp)
{
static BLocker mntent_locker;
mntent_locker.Lock();
int ret = -1;
BVolumeRoster roster;
char buf[B_PATH_NAME_LENGTH];
int buflen = 0;
BVolume volume;
BDirectory rootDir;
BEntry rootDirEntry;
BPath rootDirPath;
roster.Rewind();
for (int i = 0; i <= *cookie; i++)
if (roster.GetNextVolume(&volume) != B_NO_ERROR)
goto bail;
// volume name
volume.GetName(buf);
buflen = strlen(buf);
if (buflen == 0) {
buflen = strlen(MNTENT_MP_UNKNOWN);
strlcpy(buf, MNTENT_MP_UNKNOWN, buflen + 1);
}
mp->mnt_special = (char* )malloc(sizeof(char) * (buflen+1));
strlcpy(mp->mnt_special, buf, buflen+1);
// mount point
if (volume.GetRootDirectory(&rootDir) != B_OK ||
rootDir.GetEntry(&rootDirEntry) != B_OK ||
rootDirEntry.GetPath(&rootDirPath) != B_OK)
goto bail;
buflen = strlen(rootDirPath.Path());
mp->mnt_mountp = (char* )malloc(sizeof(char) * (buflen+1));
strlcpy(mp->mnt_mountp, rootDirPath.Path(), buflen + 1);
// partition type.
fs_info info;
if (fs_stat_dev(volume.Device(), &info) != B_OK)
goto bail;
buflen = strlen(info.fsh_name);
mp->mnt_fstype = (char* )malloc(sizeof(char) * (buflen+1));
strlcpy(mp->mnt_fstype, info.fsh_name, buflen+1);
// fs options. set default options for all file systems for now.
buflen = strlen(MNTENT_MP_DEFAULT_OPTS);
mp->mnt_mntopts = (char* )malloc(sizeof(char) * (buflen+2+1)); // extra space for ro/rw
strlcpy(mp->mnt_mntopts, MNTENT_MP_DEFAULT_OPTS, buflen + 2 + 1);
strcat(mp->mnt_mntopts, volume.IsReadOnly() ? ",ro":",rw");
// mount time. no idea how i can get this. set it to 0 for now.
buflen = 1;
mp->mnt_time = (char* )malloc(sizeof(char) * (buflen+1));
strlcpy(mp->mnt_time, "0", buflen + 1);
(*cookie)++;
ret = 0; /* success! */
bail:
mntent_locker.Unlock();
return ret;
}
示例12: if
//.........这里部分代码省略.........
fDevice = dev;
}
return B_OK;
#else // !HAVE_MNTENT_H
#ifdef _WIN32
if (dev <= 0) {
Unset();
} else if (fDevice != dev) {
if (dev > 26) return B_ENTRY_NOT_FOUND;
DWORD driveMask = GetLogicalDrives();
if (driveMask == 0) return B_ENTRY_NOT_FOUND;
if (!(driveMask & (1UL << (dev - 1)))) return B_BAD_VALUE;
if (fData == NULL) {
if ((fData = new_dev_data()) == NULL) return B_NO_MEMORY;
}
char dirname[4] = "A:\\";
*dirname += (dev - 1);
BString nameStr;
char nameBuf[301];
bzero(nameBuf, 301);
if (!(GetVolumeInformation(dirname, nameBuf, 300, NULL, NULL, NULL, NULL, 0) == 0 || nameBuf[0] == 0)) {
WCHAR wStr[301];
bzero(wStr, sizeof(WCHAR) * 301);
MultiByteToWideChar(CP_ACP, 0, nameBuf, -1, wStr, 300);
char *utf8Name = e_unicode_convert_to_utf8((const unichar*)wStr, -1);
if (utf8Name != NULL) {
nameStr.SetTo(utf8Name);
free(utf8Name);
}
}
if (nameStr.Length() <= 0) nameStr.SetTo(nameBuf);
dirname[2] = '/';
status_t status = set_dev_data((e_dev_data_t*)fData, nameStr.String(), dirname);
if (status != B_OK) return status;
fDevice = dev;
}
return B_OK;
#else // !_WIN32
#ifdef __BEOS__
if (dev <= 0) {
Unset();
} else if (fDevice != dev) {
if (fData == NULL)
if ((fData = new_dev_data()) == NULL) return B_NO_MEMORY;
BVolume vol;
BVolumeRoster volRoster;
BDirectory beDir;
BEntry beEntry;
BPath bePath;
char volName[B_FILE_NAME_LENGTH + 1];
bzero(volName, B_FILE_NAME_LENGTH + 1);
e_dev_t tmp = dev;
while (tmp > 0) {
if (volRoster.GetNextVolume(&vol) != B_OK) return B_ENTRY_NOT_FOUND;
if (--tmp > 0) continue;
if (vol.GetRootDirectory(&beDir) != B_OK ||
beDir.GetEntry(&beEntry) != B_OK ||
beEntry.GetPath(&bePath) != B_OK) return B_ENTRY_NOT_FOUND;
vol.GetName(volName);
}
status_t status = set_dev_data((e_dev_data_t*)fData, volName, bePath.Path());
if (status != B_OK) return status;
fDevice = dev;
}
return B_OK;
#else // !__BEOS__
#warning "fixme: BVolume::SetTo"
if (dev <= 0) {
Unset();
return B_OK;
} else if (fDevice != dev && dev == 1) {
if (fData == NULL)
if ((fData = new_dev_data()) == NULL) return B_NO_MEMORY;
status_t status = set_dev_data((e_dev_data_t*)fData, "root", "/");
if (status != B_OK) return status;
fDevice = dev;
return B_OK;
}
return B_ENTRY_NOT_FOUND;
#endif // __BEOS__
#endif // _WIN32
#endif // HAVE_MNTENT_H
}
示例13: VolRootMessage
bool
FolderShaper::IsFolderUntouchable(uint32 purpose, const entry_ref * a_ref)
{
// system directories
if (IsItThisFolder(a_ref, B_DESKTOP_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_TRASH_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_APPS_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_PREFERENCES_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_BEOS_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_BEOS_SYSTEM_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_BEOS_ADDONS_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_BEOS_BOOT_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_BEOS_FONTS_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_BEOS_LIB_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_BEOS_SERVERS_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_BEOS_APPS_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_BEOS_BIN_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_BEOS_ETC_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_BEOS_DOCUMENTATION_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_BEOS_PREFERENCES_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_SYSTEM_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_SYSTEM_ADDONS_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_SYSTEM_BOOT_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_SYSTEM_FONTS_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_SYSTEM_LIB_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_SYSTEM_SERVERS_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_SYSTEM_BIN_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_SYSTEM_ETC_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_SYSTEM_DOCUMENTATION_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_SYSTEM_SETTINGS_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_SYSTEM_DEVELOP_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_SYSTEM_LOG_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_SYSTEM_SPOOL_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_SYSTEM_TEMP_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_SYSTEM_VAR_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_USER_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_USER_CONFIG_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_USER_ADDONS_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_USER_BOOT_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_USER_FONTS_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_USER_LIB_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_USER_SETTINGS_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_USER_DESKBAR_DIRECTORY)) return SysDirMessage(a_ref);
// volume roots
BVolumeRoster vol_roster;
BVolume volume;
BDirectory vol_dir;
BEntry vol_entry;
entry_ref vol_ref;
while (vol_roster.GetNextVolume(& volume) == B_OK)
{
volume.GetRootDirectory(& vol_dir);
vol_dir.GetEntry(& vol_entry);
vol_entry.GetRef(& vol_ref);
if (*a_ref == vol_ref)
return VolRootMessage(a_ref);
}
// target does not support attributes
if (volume.SetTo(a_ref->device) != B_OK)
{
// message
return true;
}
if(! volume.KnowsAttr())
{
char volname[B_FILE_NAME_LENGTH];
volume.GetName(volname);
return NoAttributesMessage(purpose, a_ref, volname);
}
// and perhaps returns something for the BAlert
return false;
}