vibe.d beta banner
get vibe.d
0.7.30

Function readFile

Read a whole file into a buffer.

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.

Prototypes

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

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

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.