fileMode
Function parameters
Parameters
- mode:u32
Type definitions in this namespace
Types
- Diagnostics
- Provide this to receive detailed error messages.
- PipeOptions
- pipeToFileSystem options
- FileKind
- Type of the file returned by iterator `next` method.
- Iterator
- Iterator over entries in the tar file represented by reader.
Saves tar file content to the file systems.
Functions
- pipeToFileSystem
- Saves tar file content to the file systems.
Source
Implementation
fn fileMode(mode: u32, options: PipeOptions) std.fs.File.Mode {
if (!std.fs.has_executable_bit or options.mode_mode == .ignore)
return default_mode;
const S = std.posix.S;
// The mode from the tar file is inspected for the owner executable bit.
if (mode & S.IXUSR == 0)
return default_mode;
// This bit is copied to the group and other executable bits.
// Other bits of the mode are left as the default when creating files.
return default_mode | S.IXUSR | S.IXGRP | S.IXOTH;
}