fn mode_from_type_and_perm(file_type: FileType, perm: u16) -> u32 {
    (match file_type {
        FileType::NamedPipe => S_IFIFO,
        FileType::CharDevice => S_IFCHR,
        FileType::BlockDevice => S_IFBLK,
        FileType::Directory => S_IFDIR,
        FileType::RegularFile => S_IFREG,
        FileType::Symlink => S_IFLNK,
        FileType::Socket => S_IFSOCK,
    }) as u32 | perm as u32
}
/// Returns the mode for a given file type and permission
Returns the mode for a given file type and permission
Returns the mode for a given file type and permission
fn mode_from_type_and_perm(file_type: FileType, perm: u16) -> u32 {
    (match file_type {
        FileType::NamedPipe => S_IFIFO,
        FileType::CharDevice => S_IFCHR,
        FileType::BlockDevice => S_IFBLK,
        FileType::Directory => S_IFDIR,
        FileType::RegularFile => S_IFREG,
        FileType::Symlink => S_IFLNK,
        FileType::Socket => S_IFSOCK,
    }) as u32 | perm as u32
}
fn mode_from_type_and_perm ( file_type : FileType , perm : u16 ) -> u32 { ( match file_type { FileType :: NamedPipe => S_IFIFO , FileType :: CharDevice => S_IFCHR , FileType :: BlockDevice => S_IFBLK , FileType :: Directory => S_IFDIR , FileType :: RegularFile => S_IFREG , FileType :: Symlink => S_IFLNK , FileType :: Socket => S_IFSOCK , } ) as u32 | perm as u32 }
Returns the mode for a given file type and permission
Returns the mode for a given file type and permission
file_type
FileType
perm
u16
file_type
FileType
perm
u16