#include <ucommon/secure.h>
#include <sys/stat.h>
Go to the source code of this file.
|
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) |
|
|
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" |
|
◆ 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().
◆ report()
static void report |
( |
const char * |
path, |
|
|
int |
code |
|
) |
| |
|
static |
◆ 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().
◆ scrub()
static void scrub |
( |
const char * |
path | ) |
|
|
static |
Definition at line 96 of file scrub.cpp.
References blocks, ucommon::fsys::close(), ucommon::fsys::erase(), ucommon::fsys::err(), ucommon::Random::fill(), ucommon::fsys::info(), ucommon::is(), ucommon::fsys::is_dev(), ucommon::fsys::is_dir(), ucommon::fsys::is_link(), ucommon::fsys::is_sys(), ucommon::fsys::open(), passes, ucommon::shell::printf(), ucommon::dir::remove(), report(), ucommon::fsys::REWRITE, ucommon::fsys::seek(), simulate, ucommon::fsys::trunc(), truncflag, ucommon::fsys::unlink(), verbose, and ucommon::fsys::write().
Referenced by main(), and scan().
◆ althelp
◆ altrecursive
◆ argv0
const char* argv0 = "scrub" |
|
static |
◆ 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" |
, |
|
|
1 |
|
|
) |
| |
|
static |
◆ exit_code
◆ follow
shell::flagopt follow( 'F', "--follow", _TEXT("follow symlinks")) |
( |
'F' |
, |
|
|
"--follow" |
, |
|
|
_TEXT("follow symlinks") |
|
|
) |
| |
|
static |
◆ helpflag
shell::flagopt helpflag( 'h',"--help", _TEXT("display this list")) |
( |
'h' |
, |
|
|
"--help" |
, |
|
|
_TEXT("display this list") |
|
|
) |
| |
|
static |
◆ 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" |
, |
|
|
1 |
|
|
) |
| |
|
static |
◆ recursive
◆ 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 |
◆ truncflag
shell::flagopt truncflag( 't', "--truncate", _TEXT("decompose file by truncation")) |
( |
't' |
, |
|
|
"--truncate" |
, |
|
|
_TEXT("decompose file by truncation") |
|
|
) |
| |
|
static |
◆ verbose
shell::flagopt verbose( 'v', "--verbose", _TEXT("show active status")) |
( |
'v' |
, |
|
|
"--verbose" |
, |
|
|
_TEXT("show active status") |
|
|
) |
| |
|
static |