File.fdopen

First calls detach (throwing on failure), then attempts to associate the given file descriptor with the File, and sets the file's name to null.

The mode must be compatible with the mode of the file descriptor.

struct File
@safe
void
fdopen
(
int fd
,
scope const(char)[] stdioOpenmode = "rb"
)

Parameters

fd int

File descriptor to associate with this File.

stdioOpenmode const(char)[]

Mode to associate with this File. The mode has the same semantics as in the POSIX library function fdopen and must be compatible with fd.

Throws

ErrnoException in case of error.

Meta