ucommon  7.0.0
About: GNU uCommon C++ is a portable and optimized class framework for writing C++ applications that need to use threads and support concurrent synchronization, and that use sockets, XML parsing, object serialization, thread-optimized string and data structure classes, etc..
  Fossies Dox: ucommon-7.0.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

Loading...
Searching...
No Matches
scrub.cpp File Reference
#include <ucommon/secure.h>
#include <sys/stat.h>
Include dependency graph for scrub.cpp:

Go to the source code of this file.

Functions

static void report (const char *path, int code)
 
static void scrub (const char *path)
 
static void scan (String path, bool top=true)
 
int main (int argc, char **argv)
 

Variables

static shell::flagopt helpflag ('h',"--help", _TEXT("display this list"))
 
static shell::flagopt althelp ('?', NULL, NULL)
 
static shell::numericopt blocks ('b', "--blocksize", _TEXT("size of i/o blocks in k (1-x)"), "size k", 1)
 
static shell::flagopt follow ('F', "--follow", _TEXT("follow symlinks"))
 
static shell::numericopt passes ('p', "--passes", _TEXT("passes with randomized data (0-x)"), "count", 1)
 
static shell::flagopt renamefile ('n', "--rename", _TEXT("rename file randomly"))
 
static shell::flagopt recursive ('R', "--recursive", _TEXT("recursive directory scan"))
 
static shell::flagopt simulate ('S', "--simulate", _TEXT("produce list of files to scrub"))
 
static shell::flagopt altrecursive ('r', NULL, NULL)
 
static shell::flagopt truncflag ('t', "--truncate", _TEXT("decompose file by truncation"))
 
static shell::flagopt verbose ('v', "--verbose", _TEXT("show active status"))
 
static int exit_code = 0
 
static const char * argv0 = "scrub"
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 237 of file scrub.cpp.

References ucommon::_TEXT(), althelp, ucommon::shell::argv0(), argv0, ucommon::shell::bind(), blocks, ucommon::shell::errexit(), exit_code, ucommon::shell::help(), helpflag, ucommon::secure::init(), ucommon::is(), ucommon::fsys::is_dir(), passes, scan(), scrub(), and ucommon::str().

Here is the call graph for this function:

◆ report()

static void report ( const char *  path,
int  code 
)
static

Definition at line 39 of file scrub.cpp.

References ucommon::_TEXT(), argv0, ucommon::shell::errexit(), exit_code, ucommon::is(), ucommon::shell::printf(), and verbose.

Referenced by scrub().

Here is the call graph for this function:

◆ scan()

static void scan ( String  path,
bool  top = true 
)
static

Definition at line 210 of file scrub.cpp.

References altrecursive, follow, ucommon::is(), ucommon::fsys::is_dir(), ucommon::fsys::is_link(), ucommon::dir::read(), recursive, scan(), scrub(), and ucommon::str().

Referenced by main(), and scan().

Here is the call graph for this function:

◆ scrub()

Variable Documentation

◆ althelp

shell::flagopt althelp('?', NULL, NULL) ( '?'  ,
NULL  ,
NULL   
)
static

Referenced by main().

◆ altrecursive

shell::flagopt altrecursive( 'r', NULL, NULL) ( 'r'  ,
NULL  ,
NULL   
)
static

Referenced by scan().

◆ argv0

const char* argv0 = "scrub"
static

Definition at line 37 of file scrub.cpp.

Referenced by main(), and report().

◆ blocks

shell::numericopt blocks( 'b', "--blocksize", _TEXT("size of i/o blocks in k (1-x)"), "size k", 1) ( 'b'  ,
"--blocksize"  ,
_TEXT("size of i/o blocks in k (1-x)")  ,
"size k"  ,
 
)
static

Referenced by main(), and scrub().

◆ exit_code

int exit_code = 0
static

Definition at line 36 of file scrub.cpp.

Referenced by main(), and report().

◆ follow

shell::flagopt follow( 'F', "--follow", _TEXT("follow symlinks")) ( 'F'  ,
"--follow"  ,
_TEXT("follow symlinks")   
)
static

Referenced by scan().

◆ helpflag

shell::flagopt helpflag( 'h',"--help", _TEXT("display this list")) ( 'h'  ,
"--help"  ,
_TEXT("display this list")   
)
static

Referenced by main().

◆ passes

shell::numericopt passes( 'p', "--passes", _TEXT("passes with randomized data (0-x)"), "count", 1) ( 'p'  ,
"--passes"  ,
_TEXT("passes with randomized data (0-x)")  ,
"count"  ,
 
)
static

Referenced by main(), and scrub().

◆ recursive

shell::flagopt recursive( 'R', "--recursive", _TEXT("recursive directory scan")) ( 'R'  ,
"--recursive"  ,
_TEXT("recursive directory scan")   
)
static

Referenced by scan().

◆ renamefile

shell::flagopt renamefile( 'n', "--rename", _TEXT("rename file randomly")) ( 'n'  ,
"--rename"  ,
_TEXT("rename file randomly")   
)
static

◆ simulate

shell::flagopt simulate( 'S', "--simulate", _TEXT("produce list of files to scrub")) ( 'S'  ,
"--simulate"  ,
_TEXT("produce list of files to scrub")   
)
static

Referenced by scrub().

◆ truncflag

shell::flagopt truncflag( 't', "--truncate", _TEXT("decompose file by truncation")) ( 't'  ,
"--truncate"  ,
_TEXT("decompose file by truncation")   
)
static

Referenced by scrub().

◆ verbose

shell::flagopt verbose( 'v', "--verbose", _TEXT("show active status")) ( 'v'  ,
"--verbose"  ,
_TEXT("show active status")   
)
static

Referenced by report(), and scrub().