[saga-rg] AlreadyExists
sbrandt at cct.lsu.edu
sbrandt at cct.lsu.edu
Thu Jun 22 14:15:21 CDT 2006
Quoting Andre Merzky <andre at merzky.net>:
> There is a single case where we can't remove it (well, I
> found that one only at least): opening a file with with the
> flags (Create | Excl). That MUST raise an error, otherwise
> the flag would make no sense.
Yes, but if it really is the only place then maybe this is really a
WriteError, or some subclass thereof.
BTW, are the names of these exceptions still debatable? Because having
the name "Error" in a Java exception that is not a subclass of Error
is awkward. It would be nicer if we could call it something else like
"WriteException".
> As for mkdir, we tried to stay close to what users know from
> command line, and from POSIX/libc, which both return an
> error if the dir exists.
I think it depends. One could argue that if we want to mimic
POSIX/libc then this should show up as a return code and not an
exception. Posix does not force you to clutter your code with handling
this case every time you call mkdir().
I could see throwing an exception of some sort if, at the conslusion
of the call to mkdir(), the directory did not exist.
Cheers,
Steve
More information about the saga-rg
mailing list