search for: f_opt

Displaying 1 result from an estimated 1 matches for "f_opt".

Did you mean: f_op
2004 Sep 05
1
[PATCH] simple rm command
...483695000 +0200 @@ -0,0 +1,116 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <unistd.h> +#include <dirent.h> + +#include <linux/limits.h> + +static char *progname; +static int f_opt, r_opt; + +static int recursive_rm(const char *path); + +static int unlink_direntry(const char *p) +{ + struct stat sb; + int ret; + + if (lstat(p, &sb) < 0) { + ret = 1; + if (!f_opt) + perror(p); + goto out; + } + + if (S_ISDIR(sb.st_mode) && r_opt) + ret = recursive_rm(p); +...