// get_volume_info bool get_volume_info( BVolume& volume, BString& volumeName, bool& isCDROM, BString& deviceName ) { bool success = false; isCDROM = false; deviceName = ""; volumeName = ""; char name[B_FILE_NAME_LENGTH]; if ( volume.GetName( name ) >= B_OK ) // disk is currently mounted { volumeName = name; dev_t dev = volume.Device(); fs_info info; if ( fs_stat_dev( dev, &info ) == B_OK ) { success = true; deviceName = info.device_name; if ( volume.IsReadOnly() ) { int i_dev = open( info.device_name, O_RDONLY ); if ( i_dev >= 0 ) { device_geometry g; if ( ioctl( i_dev, B_GET_GEOMETRY, &g, sizeof( g ) ) >= 0 ) isCDROM = ( g.device_type == B_CD ); close( i_dev ); } } } } return success; }
void IndexServer::AddVolume(const BVolume& volume) { // ignore volumes like / or /dev if (volume.Capacity() == 0) return; // check if volume is already in our list for (int i = 0; i < fVolumeWatcherList.CountItems(); i++) { VolumeWatcher* current = fVolumeWatcherList.ItemAt(i); if (current->Volume() == volume) return; } char name[256]; volume.GetName(name); STRACE("IndexServer::AddVolume %s\n", name); VolumeWatcher* watcher = new VolumeWatcher(volume); /* if (!watcher->Enabled()) { delete watcher; return; }*/ fVolumeWatcherList.AddItem(watcher); _SetupVolumeWatcher(watcher); watcher->StartWatching(); }
void ControlsView::VolumeTabView::AttachedToWindow() { // Populate the menu with the persistent volumes. fVolumeRoster = new BVolumeRoster(); BVolume tempVolume; while (fVolumeRoster->GetNextVolume(&tempVolume) == B_OK) { if (!tempVolume.IsPersistent()) continue; char name[B_PATH_NAME_LENGTH]; if (tempVolume.GetName(name) != B_OK) continue; if (strcmp(name, "system") == 0 || strcmp(name, "config") == 0) { // Don't include virtual volumes. continue; } BVolume* volume = new BVolume(tempVolume); VolumeView* volumeView = new VolumeView(name, volume); VolumeTab* volumeTab = new VolumeTab(volume); AddTab(volumeView, volumeTab); } // Begin watching mount and unmount events. fVolumeRoster->StartWatching(BMessenger(this)); }
bool GeneralView::_CanFindServer(entry_ref* ref) { // Try searching with be_roster if (be_roster->FindApp(kNotificationServerSignature, ref) == B_OK) return true; // Try with a query and take the first result BVolumeRoster vroster; BVolume volume; char volName[B_FILE_NAME_LENGTH]; vroster.Rewind(); while (vroster.GetNextVolume(&volume) == B_OK) { if ((volume.InitCheck() != B_OK) || !volume.KnowsQuery()) continue; volume.GetName(volName); BQuery *query = new BQuery(); query->SetPredicate("(BEOS:APP_SIG==\""kNotificationServerSignature"\")"); query->SetVolume(&volume); query->Fetch(); if (query->GetNextRef(ref) == B_OK) return true; } return false; }
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); }
void NameAttributeText::ReadValue(BString *result) { #ifdef DEBUG // x86 support :-) if ((modifiers() & B_CAPS_LOCK) != 0) { if (fModel->IsVolume()) { BVolumeRoster roster; roster.Rewind(); BVolume volume; char device = 'A'; while (roster.GetNextVolume(&volume) == B_OK) { char name[256]; if (volume.GetName(name) == B_OK && strcmp(name, fModel->Name()) == 0) { *result += device; *result += ':'; fValueDirty = false; return; } device++; } } const char *modelName = fModel->Name(); bool hasDot = strstr(".", modelName) != 0; for (int32 index = 0; index < 8; index++) { if (!modelName[index] || modelName[index] == '.') break; *result += toupper(modelName[index]); } if (hasDot) { modelName = strstr(".", modelName); for (int32 index = 0; index < 4; index++) { if (!modelName[index]) break; *result += toupper(modelName[index]); } } else if (fModel->IsExecutable()) *result += ".EXE"; } else #endif *result = fModel->Name(); fValueDirty = false; }
void ControlsView::VolumeTabView::_AddVolume(dev_t device) { // Make sure the volume is not already in the menu. for (int i = 0; VolumeTab* item = (VolumeTab*)TabAt(i); i++) { if (item->Volume()->Device() == device) return; } BVolume* volume = new BVolume(device); VolumeTab* item = new VolumeTab(volume); char name[B_PATH_NAME_LENGTH]; volume->GetName(name); AddTab(new VolumeView(name, volume), item); Invalidate(); }
/* isVolume * checks if selected file is a volume * if yes, returns true */ bool ProjectTypeSelector::isVolume() { BString *SelectedFile = (BString*)FileList->FirstItem(); BString SelectedFileTMP; BVolumeRoster objVolumeRoster; objVolumeRoster.Rewind(); BVolume objVolume; char chVolumeName[B_FILE_NAME_LENGTH]; SelectedFile->CopyInto(SelectedFileTMP, 0, (int)SelectedFile->Length()); SelectedFileTMP.RemoveAll("/"); while(objVolumeRoster.GetNextVolume(&objVolume) != B_BAD_VALUE) { objVolume.GetName(chVolumeName); if(SelectedFileTMP.Compare(chVolumeName) == 0 && objVolume.IsReadOnly()) { fSizeOfFiles = objVolume.Capacity(); return true; } } return false; }
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; }
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; }
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); } } } }; }; return B_OK; };
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; }
status_t BVolume::SetTo(e_dev_t dev) { #ifdef HAVE_MNTENT_H if (dev <= 0) { Unset(); } else if (fDevice != dev) { FILE *ent = setmntent("/etc/fstab", "r"); if (ent == NULL) { ETK_DEBUG("[STORAGE]: %s --- Unable to open /etc/fstab", __PRETTY_FUNCTION__); return B_ENTRY_NOT_FOUND; } struct mntent *mnt = NULL; for (e_dev_t i = 0; i < dev; i++) { if ((mnt = getmntent(ent)) == NULL) break; } if (mnt == NULL) { endmntent(ent); return B_ENTRY_NOT_FOUND; } if (fData == NULL) { if ((fData = new_dev_data()) == NULL) { endmntent(ent); return B_NO_MEMORY; } } status_t status = set_dev_data((e_dev_data_t*)fData, mnt->mnt_fsname, mnt->mnt_dir); endmntent(ent); if (status != B_OK) return status; 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 }
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; }