On 2011-09-06 15:02, Steven Schveighoffer wrote:
Yeah, creating a new file is implied by a combination of modes.

The one that's confusing I think is that "a" is for append, but "+" kind
of tacks on appending to any other mode. It's not the most well-designed
spec for file opening. Add to that you have the "b" which is a noop on
most OSes.

There is the possibility that we could accept an alternative open mode
string, which we could design better. But we have to keep fopen's spec,
it's already used everywhere.

-Steve

Ok, I would prefer to use enums if they have sensible names. Something like this:

File.open(Mode.read | Mode.write); // for both read and write

--
/Jacob Carlborg

Reply via email to