vibe.d beta banner
get vibe.d
0.10.1

Asynchronous I/O that doesn’t get in your way, written in D

Function readFile

Read a whole file into a buffer.

ubyte[] readFile (
  GenericPath!(vibe.core.path.PosixPathFormat) path,
  ubyte[] buffer = null,
  ulong max_size = 18446744073709551615LU
) @safe;

ubyte[] readFile (
  string path,
  ubyte[] buffer = null,
  ulong max_size = 18446744073709551615LU
) @safe;

If the supplied buffer is large enough, it will be used to store the contents of the file. Otherwise, a new buffer will be allocated.

Parameters

NameDescription
path The path of the file to read
buffer An optional buffer to use for storing the file contents
Authors

Sönke Ludwig

Copyright

© 2012-2021 Sönke Ludwig

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.