srctree

Andrew Kelley parent f5aad472 b3ad45f2
std.tar: avoid dependency on file system

In the iterator function which is the low-level API, don't depend onstd.fs.MAX_PATH_BYTES because this is not defined on all operatingsystems, such as freestanding.

However in such environments it still makes sense to be able to extractfrom a tar file.

An even more flexible solution would be to accept the buffers asarguments to iterator() which I think is a good idea, but for now let'sjust set the same upper limmit across all operating systems.

inlinesplit
lib/std/tar.zig added: 3, removed: 3, total 0
@@ -247,8 +247,8 @@ fn Iterator(comptime ReaderType: type) type {
 
// buffers for heeader and file attributes
header_buffer: [Header.SIZE]u8 = undefined,
file_name_buffer: [std.fs.MAX_PATH_BYTES]u8 = undefined,
link_name_buffer: [std.fs.MAX_PATH_BYTES]u8 = undefined,
file_name_buffer: [1024]u8 = undefined,
link_name_buffer: [1024]u8 = undefined,
 
// bytes of padding to the end of the block
padding: usize = 0,