Go to the FreeLists Home Page Home Signup Help Login
 



[openbeosstorage] || [Date Prev] [07-2003 Date Index] [Date Next] || [Thread Prev] [07-2003 Thread Index] [Thread Next]

[openbeosstorage] Re: Disk Device API: Some semantical questions

  • From: "Ingo Weinhold" <bonefish@xxxxxxxxxxxxxxx>
  • To: openbeosstorage@xxxxxxxxxxxxx
  • Date: Thu, 10 Jul 2003 20:44:21 +0200 CEST
On Wed, 09 Jul 2003 21:37:28 -0700 tyler@xxxxxxxxxxxxx wrote:
> Since I failed to reply all when I sent the original copy of this 
> message a minute ago, and since our trusty list is back in action, 
> I'm 
> reposting it here. Sorry to Ingo for getting two copies... :-)
> ---------------------------------------------------------------------
> -
> 
> On 2003-07-08 at 10:28:25 [-0700], Ingo Weinhold wrote:
> [...determining BDiskDevice::IsReadOnly()...]
> > Mmh, our
> > DriveSetup would have no way of checking whether it can work on the
> > device (i.e. initialize partitions or the device itself) -- other 
> > than
> > opening the device manually and do a B_GET_DEVICE_GEOMETRY ioctl, 
> > of
> > course. 
> 
> Couldn't it just try to open the device read-write?

I'm not sure, what the policy for opening devices is. E.g. a read-only 
device could allow to be opened for writing as well, but may fail only, 
when one actually tries to write something to it. But anyway, the point 
is, that you would have to use another API to get the information.

> On 2003-07-08 at 10:28:25 [-0700], Ingo Weinhold wrote:
> > I would at least add a BDiskDevice::DeviceFlags() (we already
> > have BPartition::Flags()), which would comprise this and other 
> > flags.
> 
> Which other flags?

Like whether the media is removable and/or write once.

> On 2003-07-08 at 14:35:43 [-0700], Ingo Weinhold wrote:
> > On Tue, 08 Jul 2003 22:31:07 +0200 CEST "Axel Dörfler" <axeld@pinc-
> > > BTW my question originally aimed at the "OR" part of the first 
> > > quoted
> > > paragraph. If it's interesting for the user if the disk system 
> > > has
> > > write capabilities or not, it should not be ORed with
> > > IsReadOnlyMedia()
> > > but be separately accessible.
> > 
> > Mmh, I guess, I find it more convenient, if 
> > BPartition::IsReadOnly()
> > does the OR. The information the caller is interested in, is 
> > probably
> > whether they can modify the partition's contents. The info whether 
> > the
> > disk system in general does support writing or not is perhaps 
> > better
> > provided via something like BDiskSystem::IsReadOnly().
> 
> That's why I suggested it 4 replies ago. :-) :-P

I have the vague memory of indeed having read something like this from 
you. :-)

> At any rate, I like 
> the OR-semantics for BPartition::ReadOnly() as well.

Cool. So I won't change it.

BTW, what kind of partitions does 
BDiskDeviceRoster::VisitEachInitializablePartition() visit, i.e. what 
is an initializable partition? Something like the device is not read-
only and there exists a disk system for which the partition's 
CanInitialize() would return true? Sounds a bit complicated.

CU, Ingo






[ Home | Signup | Help | Login | Archives | Lists ]

All trademarks and copyrights within the FreeLists archives are owned by their respective owners.
Everything else ©2007 Avenir Technologies, LLC.