Function readFileAlloc [src]

On success, caller owns returned buffer. If the file is larger than max_bytes, returns error.FileTooBig. On Windows, file_path should be encoded as WTF-8. On WASI, file_path should be encoded as valid UTF-8. On other platforms, file_path is an opaque sequence of bytes with no particular encoding.

Prototype

pub fn readFileAlloc(self: Dir, allocator: mem.Allocator, file_path: []const u8, max_bytes: usize) ![]u8

Parameters

self: Dirallocator: mem.Allocatorfile_path: []const u8max_bytes: usize

Source

pub fn readFileAlloc(self: Dir, allocator: mem.Allocator, file_path: []const u8, max_bytes: usize) ![]u8 { return self.readFileAllocOptions(allocator, file_path, max_bytes, null, @alignOf(u8), null); }