File.close

If the file was closed or not yet opened, succeeds vacuously. Otherwise closes the file (by calling $(CSTDIO fclose)), throwing on error. Even if an exception is thrown, afterwards the File object is empty. This is different from detach in that it always closes the file; consequently, all other File objects referring to the same handle will see a closed file henceforth.

struct File
@trusted
void
close
()

Throws

ErrnoException on error.

Meta