diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-08-05 10:24:34 -0400 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-08-05 10:25:05 -0400 |
commit | 79f99847fe4c3c1086ab6ce943969e01fd15b587 (patch) | |
tree | 4776732f3bcdda9a393719a98f1760e4c1b9839b /src/unix.rs | |
parent | 8105aa532c7fca7160ba3ce9303ba7613c59d277 (diff) |
rework how mimetype configuration works
- config file is now easier to visually parse and edit
- fix opening files via open_with
Diffstat (limited to 'src/unix.rs')
-rw-r--r-- | src/unix.rs | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/src/unix.rs b/src/unix.rs index 7904ee9..03c20b1 100644 --- a/src/unix.rs +++ b/src/unix.rs @@ -1,8 +1,6 @@ use std::path::{Path, PathBuf}; use std::process; -use crate::config::mimetype; - pub fn is_executable(mode: u32) -> bool { const LIBC_PERMISSION_VALS: [libc::mode_t; 3] = [libc::S_IXUSR, libc::S_IXGRP, libc::S_IXOTH]; @@ -66,19 +64,3 @@ pub fn set_mode(path: &Path, mode: u32) { } } } - -pub fn open_with_args(paths: &[&PathBuf], args: &[String]) { - let program = args[0].clone(); - - let mut command = process::Command::new(program); - command.args(args[1..].iter().cloned()); - command.args(paths.iter().map(|path| path.as_os_str())); - - match command.spawn() { - Ok(mut handle) => match handle.wait() { - Ok(_) => {} - Err(e) => eprintln!("{}", e), - }, - Err(e) => eprintln!("{}", e), - } -} |