[m-users.] Bug in posix.readdir (fixed)

Volker Wysk post at volker-wysk.de
Mon Oct 14 13:38:39 AEDT 2019


Am Montag, den 14.10.2019, 13:09 +1100 schrieb Julien Fischer:
> On Mon, 14 Oct 2019, Volker Wysk wrote:
> 
> > Not sure if I understand correctly, but wouldn't it just be one
> > level
> > of switching:
> > 
> >    readdir(Dir, Res, !IO),
> >    (
> >        Res = ok(yes(File)),
> > 	...
> >    ;
> > 	Res = ok(no),
> > 	...
> >    ;
> > 	Res = error(Err),
> > 	...
> >    )
> 
> Zoltan's already beaten me to the punch with the explanation.
> The other reason for preferring this output type is that it is
> more consistent with how the standard library handles such
> result types (e.g. in the io and stream modules).

You're right. There is the type "result(string)", in the io library,
which is the same as the proposed "readdir_result".

Cheers
Volker



More information about the users mailing list