clircle crate helps you detect IO circles in your CLI applications.
Imagine you want to read data from a couple of files and output something according to the contents of these files. If the user redirects the output of your program to one of the input files, you might end up in an infinite circle of reading and writing.
The crate provides the struct
Identifier which is a platform dependent type alias, so that
you can use it on all platforms and do not need to introduce any conditional compilation
On both Unix and Windows systems,
Identifier holds information to identify a file on a disk.
Clircle trait is implemented on both of these structs and requires
TryFrom for the
clircle::Stdio enum and for
&Path, so that all possible inputs can be represented as an
Clircle is a subtrait of
Eq, so that the identifiers can be conveniently compared
and circles can be detected.
clircle crate also provides some convenience functions around the comparison of
The three stdio streams.
Finds a common
Identifies a file. The type is aliased according to the target platform.