octal
Function parameters
Parameters
- buf:[]u8
- value:u64
Options for writing file/dir/link.
Types
Sets prefix for all other write* method paths.
Functions
- setRoot
- Sets prefix for all other write* method paths.
- writeFileStream
- Writes file reading file content from `reader`.
- writeFileBytes
- Writes file using bytes buffer `content` for size and file content.
- finishPedantically
- According to the specification, tar should finish with two zero blocks, but
Error sets in this namespace
Error Sets
Source
Implementation
fn octal(buf: []u8, value: u64) error{OctalOverflow}!void {
var remainder: u64 = value;
var pos: usize = buf.len;
while (remainder > 0 and pos > 0) {
pos -= 1;
const c: u8 = @as(u8, @intCast(remainder % 8)) + '0';
buf[pos] = c;
remainder /= 8;
if (pos == 0 and remainder > 0) return error.OctalOverflow;
}
}