FileBase.this

Takes control of a file handle.

It is assumed that we have exclusive control over the file handle and will be closed upon destruction as usual. If non-exclusive control is desired, use dup instead.

This function is useful in a couple of situations:

  • The file must be opened with special flags that cannot be obtained via FileFlags
  • A special file handle must be opened (e.g., stdout, a pipe).
  1. this(const(char)[] name, FileFlags flags)
  2. this(Handle h)
    struct FileBase
    this

Parameters

h Handle

The handle to assume control over. For Posix, this is a file descriptor (int). For Windows, this is an object handle (HANDLE).

Meta