mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-24 20:28:06 +02:00
Added foundational modules for core functionalities:
- Introduced `walk.rs` as a parallel directory walker for search operations. - Implemented basic index handling in `commands/index.rs`. - Created `utils/config.rs` for configuration management with placeholders for future enhancements.
This commit is contained in:
commit
ab5558f537
16 changed files with 2187 additions and 0 deletions
43
src/filetypes.rs
Normal file
43
src/filetypes.rs
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
// use crate::dir_entry;
|
||||
// use crate::filesystem;
|
||||
//
|
||||
// use faccess::PathExt;
|
||||
//
|
||||
// /// Whether or not to show
|
||||
// #[derive(Default)]
|
||||
// pub struct FileTypes {
|
||||
// pub files: bool,
|
||||
// pub directories: bool,
|
||||
// pub symlinks: bool,
|
||||
// pub block_devices: bool,
|
||||
// pub char_devices: bool,
|
||||
// pub sockets: bool,
|
||||
// pub pipes: bool,
|
||||
// pub executables_only: bool,
|
||||
// pub empty_only: bool,
|
||||
// }
|
||||
//
|
||||
// impl FileTypes {
|
||||
// pub fn should_ignore(&self, entry: &dir_entry::DirEntry) -> bool {
|
||||
// if let Some(ref entry_type) = entry.file_type() {
|
||||
// (!self.files && entry_type.is_file())
|
||||
// || (!self.directories && entry_type.is_dir())
|
||||
// || (!self.symlinks && entry_type.is_symlink())
|
||||
// || (!self.block_devices && filesystem::is_block_device(*entry_type))
|
||||
// || (!self.char_devices && filesystem::is_char_device(*entry_type))
|
||||
// || (!self.sockets && filesystem::is_socket(*entry_type))
|
||||
// || (!self.pipes && filesystem::is_pipe(*entry_type))
|
||||
// || (self.executables_only && !entry.path().executable())
|
||||
// || (self.empty_only && !filesystem::is_empty(entry))
|
||||
// || !(entry_type.is_file()
|
||||
// || entry_type.is_dir()
|
||||
// || entry_type.is_symlink()
|
||||
// || filesystem::is_block_device(*entry_type)
|
||||
// || filesystem::is_char_device(*entry_type)
|
||||
// || filesystem::is_socket(*entry_type)
|
||||
// || filesystem::is_pipe(*entry_type))
|
||||
// } else {
|
||||
// true
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
Loading…
Add table
Add a link
Reference in a new issue