vibe.d beta banner
get vibe.d
0.7.31

Function readFile

Read a whole file into a buffer.

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

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

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-2014 RejectedSoftware e.K.

License

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