[erlang-bugs] io device() type incomplete

Hans Bolinder hans.bolinder@REDACTED
Wed Mar 26 12:37:02 CET 2014


Hi,

[Steve Vinoski]:
>  The io man page defines the device() type as follows:
>      device() = atom() | pid()
>
>      An IO device. Either standard_io, standard_error, a registered
>      name, or a pid handling IO protocols (returned from file:open/2).
>
>    But this is incomplete, since file:open/2 can also return an
>    instance of a file_descriptor record.
>
> Also meant to add that there are functions in the io module that take
> device() type parameters but do not handle file_descriptor records.

If file:open() is called with the 'raw' option a file_descriptor
record is returned. It cannot be used with the io module.

I'm not sure, but perhaps you've confused the types io:device() and
file:io_device() with each other?

Best regards,

Hans Bolinder, Erlang/OTP team, Ericsson

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20140326/1530d9f9/attachment.htm>


More information about the erlang-bugs mailing list