[ruby-core:72835] Re: [Ruby trunk - Bug #11973] IO#advise should raise NotImplementedError on platforms that do not support that call

From: Eric Wong <normalperson@...>
Date: 2016-01-13 00:06:38 UTC
List: ruby-core #72835
git@chuckremes.com wrote:
> 3. If the platform DOES NOT SUPPORT posix_fadvise, then it should
> raise NotImplementedError in all cases.
> 
> I hope that is more clear. These rules should make IO#advise MORE CONSISTENT.

I disagree.  File#link is not analogous, nor are any other methods in
Ruby.  Unlike existing methods, IO#advise is a hint, not an imperative
command.

Things are supposed to go horribly wrong if errors to imperative
commands are not reported properly.  However, advice should be safely
ignorable without catastrophe.


Furthermore, if (and a big "if") we were to start raising
NotImplementedError, it would break existing users who (perhaps
unknowingly) rely on that behavior.

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread