4 exit : 1 when deleting one of the files failed
7 #include <sys/syscalls.h>
14 #define RMS_FILE_IS_DIR 1
16 static int do_delete(const char *name
)
18 struct file_stat stat
;
19 int err
= _kern_rstat(name
,&stat
);
23 if(stat
.type
== STREAM_TYPE_DIR
) return RMS_FILE_IS_DIR
;
28 int main(int argc
,char *argv
[])
38 printf("rm: Missing arguments\n");
43 for(cnt
=1;cnt
<argc
;cnt
++){
45 err
= do_delete(name
);
50 err_text
= "File is a directory";
52 err_text
= strerror(err
);
54 printf("rm: %s \n",err_text
);