file: module and character special files

klacke <>
Tue Mar 2 11:03:36 CET 2004


On Fri, Jan 30, 2004 at 05:15:39PM +0100, Patrik Nyblom wrote:

> Someone decided, a long time ago, that EISDIR was a good return value 
> here, when something
> on the line of "this is not a regular file" would have been better. That 
> may have been a bad choise.
> However, changing return values isn't all that popular among people 
> having miljons of lines of code
> slushing around in systems supposed to have an ISP of 99.999 or better. 



Hehehe,

Patrik, assume you're the SW lead for such a software project and have:

1. Requirements to have all thooose nine's in the uptime stats.
2. Programmers that write code that rely on the above bug: such as
   for example:



open_dev(F) ->
    case file:open(F, read) of
       {ok, Fd} ->
            do_dev_shit(Fd);
	{error, eisdir} ->
	    %% Ahhhh, it's gotta be /dev/null or somesuch
	    do_clever_chardev_stuff(F);
	{error, Reason} ->
	    {error, Reason}
    end.


Well then, your're most certainly going to loose out
on all thooooose nines anyway. 
:-)


I'd recommend promoting the programmer to more
managerial types of tasks where the damage done is better
controlled.

/klacke


-- 
Claes Wikstrom                        -- Caps lock is nowhere and
http://www.hyber.org                  -- everything is under control          



More information about the erlang-questions mailing list