diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-03-30 15:11:08 -0400 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-03-30 15:11:08 -0400 |
commit | 554f06d72aeb639548314336b2318e14f8ffcc7e (patch) | |
tree | 4f3346fdd7b9302ccaa82089cd7eceff4d8b28de /src/unix.rs | |
parent | f56511becd2be285ff2ce74269113384856aaa95 (diff) |
move view struct out of Context and pass in as a separate argument
- rename static variables to all caps
- change index to be Option<usize> rather than i32 where -1 means
the directory is empty
Diffstat (limited to 'src/unix.rs')
-rw-r--r-- | src/unix.rs | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/src/unix.rs b/src/unix.rs index 0fd2b8a..2ebb341 100644 --- a/src/unix.rs +++ b/src/unix.rs @@ -3,27 +3,6 @@ use std::process; use crate::config::mimetype; -/* -pub const fn is_reg(mode: u32) -> bool -{ - mode >> 9 & S_IFREG >> 9 == mode >> 9 -} - -pub fn get_unix_filetype(mode : u32) -> &'static str -{ - match mode & BITMASK { - S_IFBLK => "inode/blockdevice", - S_IFCHR => "inode/chardevice", - S_IFDIR => "inode/directory", - S_IFIFO => "inode/fifo", - S_IFLNK => "inode/symlink", - S_IFSOCK => "inode/socket", - S_IFREG => "inode/regular", - _ => "unknown", - } -} -*/ - pub fn is_executable(mode: u32) -> bool { const LIBC_PERMISSION_VALS: [libc::mode_t; 3] = [libc::S_IXUSR, libc::S_IXGRP, libc::S_IXOTH]; |