/// Create a mode integer for a given FileType and permission.
Create a mode integer for a given FileType and permission.
Create a mode integer for a given FileType and permission .
fn mode_from_type_and_perm(file_type: FileType, perm: u16) -> u32 {
    u32::from(match file_type {
        FileType::NamedPipe => libc::S_IFIFO,
        FileType::CharDevice => libc::S_IFCHR,
        FileType::BlockDevice => libc::S_IFBLK,
        FileType::Directory => libc::S_IFDIR,
        FileType::RegularFile => libc::S_IFREG,
        FileType::Symlink => libc::S_IFLNK,
        FileType::Socket => libc::S_IFSOCK,
    }) | u32::from(perm)
}
fn mode_from_type_and_perm ( file_type : FileType , perm : u16 ) -> u32 { u32 :: from ( match file_type { FileType :: NamedPipe => libc :: S_IFIFO , FileType :: CharDevice => libc :: S_IFCHR , FileType :: BlockDevice => libc :: S_IFBLK , FileType :: Directory => libc :: S_IFDIR , FileType :: RegularFile => libc :: S_IFREG , FileType :: Symlink => libc :: S_IFLNK , FileType :: Socket => libc :: S_IFSOCK , } ) | u32 :: from ( perm ) }
Create a mode integer for a given FileType and permission.
Create a mode integer for a given FileType and permission .
file_type
FileType
perm
u16