Implemented option -rmdir
This commit is contained in:
@ -1422,7 +1422,14 @@ int Xorriso_rmi(struct XorrisO *xorriso, void *boss_iter,
|
||||
|
||||
if(LIBISO_ISDIR(victim_node))
|
||||
is_dir= 1;
|
||||
if(is_dir) {
|
||||
if(!is_dir) {
|
||||
if(flag&2) { /* rmdir */
|
||||
sprintf(xorriso->info_text, "%s in loaded ISO image is not a directory",
|
||||
Text_shellsafe(path, sfe, 0));
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
|
||||
ret= 0; goto ex;
|
||||
}
|
||||
} else {
|
||||
if(flag&1) { /* rm -r */
|
||||
if(xorriso->do_reassure==1 && !xorriso->request_not_to_ask) {
|
||||
/* Iterate over subordinates and delete them */
|
||||
@ -1469,7 +1476,9 @@ int Xorriso_rmi(struct XorrisO *xorriso, void *boss_iter,
|
||||
iter= iso_tree_node_children((struct iso_tree_node_dir *) victim_node);
|
||||
Xorriso_process_msg_queues(xorriso,0);
|
||||
if(iso_tree_iter_next(iter)!=NULL) {
|
||||
sprintf(xorriso->info_text, "Directory not empty on attempt to delete");
|
||||
sprintf(xorriso->info_text,
|
||||
"Directory not empty on attempt to delete: %s",
|
||||
Text_shellsafe(path, sfe, 0));
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
|
||||
ret= 0; goto ex;
|
||||
}
|
||||
|
Reference in New Issue
Block a user