Struct fclones::config::Config [−][src]
pub struct Config {}Show fields
pub output: Option<PathBuf>, pub format: OutputFormat, pub stdin: bool, pub depth: Option<usize>, pub skip_hidden: bool, pub follow_links: bool, pub hard_links: bool, pub transform: Option<String>, pub in_place: bool, pub no_copy: bool, pub rf_over: Option<usize>, pub rf_under: Option<usize>, pub unique: bool, pub min_size: FileLen, pub max_size: Option<FileLen>, pub name_patterns: Vec<String>, pub path_patterns: Vec<String>, pub exclude_patterns: Vec<String>, pub caseless: bool, pub regex: bool, pub threads: Vec<(OsString, Parallelism)>, pub quiet: bool, pub paths: Vec<PathBuf>,
Finds duplicate, unique, under- or over-replicated files
Fields
output: Option<PathBuf>
Writes the report to a file instead of the standard output
format: OutputFormat
Sets output file format
stdin: bool
Reads the list of input paths from the standard input instead of the arguments.
This flag is mostly useful together with find
utility.
depth: Option<usize>
Limits recursion depth.
0 disables descending into directories. 1 descends into directories specified explicitly as input paths, but does not descend into subdirectories.
Skips hidden files
follow_links: bool
Follows symbolic links
hard_links: bool
Treats files reachable from multiple paths through hard links as duplicates
transform: Option<String>
Before matching, transforms each file by the specified program. The value of this parameter should contain a command: the path to the program and optionally a list of space-separated arguments.
By default, the file to process will be piped to the standard input of the program and the processed data will be read from the standard output. If the program does not support piping, but requires its input and/or output file path(s) to be specified in the argument list, denote these paths by $IN and $OUT special variables. If $IN is specified in the command string, the file will not be piped to the standard input, but copied first to a temporary location and that temporary location will be substituted as the value of $IN when launching the transform command. Similarly, if $OUT is specified in the command string, the result will not be read from the standard output, but fclones will expect the program to write to a named pipe specified by $OUT and will read output from there. If the program modifies the original file in-place without writing to the standard output nor a distinct file, use –in-place flag.
in_place: bool
Set this flag if the command given to –transform transforms the file in-place, i.e. it modifies the original input file instead of writing to the standard output or to a new file. This flag tells fclones to read output from the original file after the transform command exited.
no_copy: bool
Doesn’t copy the file to a temporary location before transforming, when $IN parameter is specified in the –transform command. If this flag is present, $IN will point to the original file. Caution: this option may speed up processing, but it may cause loss of data because it lets the transform command to work directly on the original file.
rf_over: Option<usize>
Searches for over-replicated files with replication factor above the specified value.
Specifying neither --rf-over
nor --rf-under
is equivalent to --rf-over 1
which would
report duplicate files.
rf_under: Option<usize>
Searches for under-replicated files with replication factor below the specified value.
Specifying --rf-under 2
will report unique files.
unique: bool
Instead of searching for duplicates, searches for unique files.
min_size: FileLen
Minimum file size in bytes. Units like KB, KiB, MB, MiB, GB, GiB are supported. Inclusive.
max_size: Option<FileLen>
Maximum file size in bytes. Units like KB, KiB, MB, MiB, GB, GiB are supported. Inclusive.
name_patterns: Vec<String>
Includes only file names matched fully by any of the given patterns.
path_patterns: Vec<String>
Includes only paths matched fully by any of the given patterns.
exclude_patterns: Vec<String>
Excludes paths matched fully by any of the given patterns.
caseless: bool
Makes pattern matching case-insensitive
regex: bool
Expects patterns as Perl compatible regular expressions instead of Unix globs
threads: Vec<(OsString, Parallelism)>
Sets the sizes of thread-pools
The spec has the following format: [<name>:]<r>[,<s>]
.
The name can be one of:
(1) a physical block device when prefixed with dev:
e.g. dev:/dev/sda
;
(2) a type of device - ssd
, hdd
, removable
or unknown
;
(3) a thread pool or thread pool group - main
, default
.
If the name is not given, this option sets the size of the main thread pool
and thread pools dedicated to SSD devices.
The values r
and s
are integers denoting the sizes of the
thread-pools used respectively for random access I/O and sequential I/O.
If s
is not given, it is assumed to be the same as r
.
This parameter can be used multiple times to configure multiple thread pools.
quiet: bool
Suppresses progress reporting
paths: Vec<PathBuf>
A list of input paths.
Accepts files and directories.
By default descends into directories recursively, unless a recursion depth
limit is specified with --depth
.
Implementations
impl Config
[src]
pub fn path_selector(
&self,
base_dir: &Path
) -> Result<PathSelector, PatternError>
[src]
&self,
base_dir: &Path
) -> Result<PathSelector, PatternError>
pub fn rf_over(&self) -> usize
[src]
pub fn rf_under(&self) -> usize
[src]
pub fn search_type(&self) -> &'static str
[src]
pub fn input_paths(&self) -> Box<dyn Iterator<Item = Path> + Send>
[src]
Returns an iterator over the input paths. Input paths may be provided as arguments or from standard input.
pub fn transform(&self) -> Option<Result<Transform>>
[src]
Constructs the transform object. Returns None if the transform was not set
pub fn thread_pool_sizes(&self) -> HashMap<OsString, Parallelism>
[src]
Trait Implementations
impl Debug for Config
[src]
impl Default for Config
[src]
impl StructOpt for Config
[src]
fn clap<'a, 'b>() -> App<'a, 'b>
[src]
fn from_clap(matches: &ArgMatches<'_>) -> Self
[src]
pub fn from_args() -> Self
[src]
pub fn from_args_safe() -> Result<Self, Error>
[src]
pub fn from_iter<I>(iter: I) -> Self where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
[src]
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
pub fn from_iter_safe<I>(iter: I) -> Result<Self, Error> where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
[src]
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
impl StructOptInternal for Config
[src]
fn augment_clap<'a, 'b>(app: App<'a, 'b>) -> App<'a, 'b>
[src]
fn is_subcommand() -> bool
[src]
pub fn from_subcommand(
_sub: (&'b str, Option<&'b ArgMatches<'a>>)
) -> Option<Self>
[src]
_sub: (&'b str, Option<&'b ArgMatches<'a>>)
) -> Option<Self>
Auto Trait Implementations
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,