Function kind [src]

Returns the Kind of the file

Prototype

pub fn kind(self: Self) Kind

Parameters

self: Self

Source

pub fn kind(self: Self) Kind { const m = self.statx.mode & posix.S.IFMT; switch (m) { posix.S.IFBLK => return .block_device, posix.S.IFCHR => return .character_device, posix.S.IFDIR => return .directory, posix.S.IFIFO => return .named_pipe, posix.S.IFLNK => return .sym_link, posix.S.IFREG => return .file, posix.S.IFSOCK => return .unix_domain_socket, else => {}, } return .unknown; }