📄 rmtool.c
字号:
/* rmtool.c 22.09.99 tn simple program that deletes some files on the harddrive and give nice parseable output. Because I do this in an external programm, the GUI-interface wont be lagging due the long unlink-calls. does not complain when an .inf file can't be deleted*/#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <string.h>#include <strings.h>#include <errno.h>#include <glib.h>#include "xcdroast.h"gint main(gint argc, gchar **argv) {gint i;gchar tmp[MAXLINE];gint inffile;gchar *p;gint errflag; if (argc <= 1) { g_print("Usage: rmtool [list of files to delete] (Version: %s)\n", XCDROAST_VERSION); exit(1); } g_print("\nStarting to delete files...\n"); fflush(stdout); errflag = 0; /* loop through the arguments */ for (i = 1; i < argc; i++) { /* check if an .inf file */ inffile = 0; strncpy(tmp,argv[i],MAXLINE); p = rindex(tmp,'.'); if (p != NULL) { if ((strncmp(p,XCDROAST_INFO_EXT,MAXLINE) == 0) || (strncmp(p,CDDA2WAV_INFO_EXT,MAXLINE) == 0)) { inffile = 1; } } if (unlink(argv[i]) != 0) { if (inffile == 0) { /* keep silent when try to delete inffile */ g_print("Error deleting %s: %s\n",argv[i], strerror(errno)); errflag = 1; } } else { g_print("Deleted %s successfully.\n", argv[i]); } g_print(" %d%%\n", (gint) ( (gfloat)i/(argc-1)*100.0)); fflush(stdout); } return errflag;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -