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 ("inofficial" and yet experimental doxygen-generated source code documentation) 
|
Go to the documentation of this file. 32 static const char *
argv0 =
"md";
35 static void result(
const char *path,
int code)
37 const char *err =
_TEXT(
"i/o error");
42 err =
_TEXT(
"permission denied");
45 err =
_TEXT(
"read-only file system");
49 err =
_TEXT(
"no such file or directory");
52 err =
_TEXT(
"not a directory");
55 err =
_TEXT(
"directory not empty");
58 err =
_TEXT(
"no space left on device");
62 err =
_TEXT(
"bad file path");
66 err =
_TEXT(
"file or directory busy");
69 err =
_TEXT(
"operation interupted");
72 err =
_TEXT(
"is a directory");
76 err =
_TEXT(
"too many sym links");
97 static void digest(
const char *path = NULL)
144 while(
is(
dir) &&
dir.
read(filename,
sizeof(filename))) {
145 if(*filename ==
'.' && (filename[1] ==
'.' || !filename[1]))
151 filepath =
str(path) +
str(
"/") +
str(filename);
154 scan(filepath,
false);
163 int main(
int argc,
char **argv)
166 shell args(argc, argv);
173 printf(
"%s\n",
_TEXT(
"Usage: mdsum [options] path..."));
174 printf(
"%s\n\n",
_TEXT(
"Compute digests for files"));
175 printf(
"%s\n",
_TEXT(
"Options:"));
177 printf(
"\n%s\n",
_TEXT(
"Report bugs to dyfet@gnu.org"));
194 else while(count < args()) {
static shell::flagopt altrecursive('r', NULL, NULL)
static void bind(const char *name)
ssize_t read(void *buffer, size_t count)
int main(int argc, char **argv)
static shell::flagopt althelp('?', NULL, NULL)
static void scan(String path, bool top=true)
static void result(const char *path, int code)
static bool has(const char *name)
static void static void errexit(int exitcode, const char *format=NULL,...) __PRINTF(2
static bool is_sys(struct stat *inode)
int info(fileinfo_t *buffer)
static shell::flagopt hidden('s', "--hidden", _TEXT("show hidden files"))
void assign(fd_t descriptor)
static void digest(const char *path=NULL)
static shell::flagopt helpflag('h',"--help", _TEXT("display this list"))
String str(Socket &so, size_t size)
static bool is_dir(const char *path)
static uint8_t buffer[65536]
static shell::stringopt hash('d', "--digest", _TEXT("digest method (md5)"), "method", "md5")
ssize_t read(char *buffer, size_t count)
void open(const char *path, access_t access)
const char * argv0() const
static const char * argv0
static shell::flagopt recursive('R', "--recursive", _TEXT("recursive directory scan"))
bool put(const void *memory, size_t size)
static size_t printf(const char *format,...) __PRINTF(1
const char * _TEXT(const char *s)