[openbeosstorage] Re: BDiskSystem::Supports*()/Validate*()

  • From: "Ingo Weinhold" <bonefish@xxxxxxxxxxxxxxx>
  • To: openbeosstorage@xxxxxxxxxxxxx
  • Date: Tue, 29 Jul 2003 14:54:45 +0200 CEST

On Tue, 29 Jul 2003 01:05:45 +0200 CEST "Axel Dörfler" <axeld@pinc-
software.de> wrote:
> "Ingo Weinhold" <bonefish@xxxxxxxxxxxxxxx> wrote:
[...]
> > Resize() wouldn't have the `resizeContents' parameter anymore, 
> > since 
> > it 
> > would always resize the contents. The question is, what should be 
> > done, 
> > if the content disk system doesn't support resizing. I guess, it 
> > would 
> > be consequent to just fail then.
> 
> Or have a "force" parameter. To give a somewhat dumb example, what I 
> needed to do once after Windows fdisk messed up my hard drive: I 
> needed 
> to recreate the old partitions *without* destroying the contents at 
> all 
> (at least, that was the plan :-)).
> But I guess that's a very special need that probably shouldn't be 
> addressed by the API at all.
> 
> > BTW, Move() could work similar: The `bool force' parameter could be 
> > dropped and the method would fail, if any descendant's contents 
> > could 
> > not be moved. The API user would need to invoke Uninitialize() on 
> > the 
> > concerned partitions before calling Move().
> 
> Or have the "force" parameter with Resize() as well :)

I don't like the `force' parameters that much. What actually will 
happen is a bit open: Maybe the contents are wiped, maybe not. This is 
done according to well-defined rules, but unless you call Validate*() 
before you couldn't know. That's why I would prefer Resize() and Move() 
to be safe (always fail if any content doesn't like the operation), so 
that the API user is forced to uninitialize concerned partitions 
manually.

CU, Ingo


Other related posts: