Lines Matching refs:device

26 	"       %s unregister ( <file> | <device path> | <device ID> )\n"
28 "Registers a regular file as disk device, unregisters an already "
54 BDiskDevice device;
55 while (roster.GetNextDevice(&device) == B_OK) {
56 if (!device.IsFile())
60 printf("%6" B_PRId32 " ", device.ID());
65 device.GetFilePath(&path) == B_OK ? path.Path() : "???");
67 // device path
68 printf("%s", device.GetPath(&path) == B_OK ? path.Path() : "???");
97 fprintf(stderr, "Error: Failed to register file disk device: %s\n",
102 // print the success message (get the device path)
103 BDiskDevice device;
105 if (roster.GetDeviceWithID(id, &device) == B_OK
106 && device.GetPath(&path) == B_OK) {
107 printf("Registered file as disk device \"%s\" with ID %" B_PRId32 ".\n",
110 printf("Registered file as disk device with ID %" B_PRId32 ", "
111 "but failed to get the device path.\n", id);
126 BDiskDevice device;
127 if (roster.GetDeviceWithID(id, &device) == B_OK && device.IsFile()) {
130 fprintf(stderr, "Error: Failed to unregister file disk device "
135 printf("Unregistered file disk device with ID %" B_PRId32 ".\n",
139 fprintf(stderr, "No file disk device with ID %" B_PRId32 ","
160 BDiskDevice device;
161 while (roster.GetNextDevice(&device) == B_OK) {
162 if (!device.IsFile())
165 // get file path and stat it, same for the device path
168 if ((device.GetFilePath(&path) == B_OK && lstat(path.Path(), &st) == 0
171 || (device.GetPath(&path) == B_OK && lstat(path.Path(), &st) == 0
173 status_t error = roster.UnregisterFileDevice(device.ID());
175 fprintf(stderr, "Error: Failed to unregister file disk device"
177 isFilePath ? " for file" : "", fileNameOrID, device.ID(),
182 printf("Unregistered file disk device%s \"%s\" "
184 fileNameOrID, device.ID());
190 fprintf(stderr, "Error: \"%s\" does not refer to a file disk device.\n",