New option -hide

This commit is contained in:
2010-06-20 16:48:28 +00:00
parent 17689fd537
commit 7cac6fcfbf
11 changed files with 203 additions and 67 deletions

View File

@ -1613,6 +1613,30 @@ int Xorriso_widen_hardlink(struct XorrisO *xorriso, void * boss_iter,
}
int Xorriso_set_hidden(struct XorrisO *xorriso, void *in_node, char *path,
int hide_state, int flag)
{
int ret, hide_attrs= 0;
IsoNode *node;
node= (IsoNode *) in_node;
if(node == NULL) {
ret= Xorriso_get_node_by_path(xorriso, path, NULL, &node, 0);
if(ret<=0)
return(ret);
}
if(hide_state) {
hide_attrs|= LIBISO_HIDE_BUT_WRITE;
if(hide_state & 1)
hide_attrs|= LIBISO_HIDE_ON_RR;
if(hide_state & 2)
hide_attrs|= LIBISO_HIDE_ON_JOLIET;
}
iso_node_set_hidden(node, hide_attrs);
return(1);
}
int Xorriso_cannot_create_iter(struct XorrisO *xorriso, int iso_error,int flag)
{
Xorriso_process_msg_queues(xorriso,0);
@ -1743,7 +1767,7 @@ int Xorriso_findi_action(struct XorrisO *xorriso, struct FindjoB *job,
char *abs_path, char *show_path,
IsoNode *node, int depth, int flag)
{
int ret= 0, type, action= 0, hflag, deleted= 0, no_dive= 0, hide_attrs;
int ret= 0, type, action= 0, hflag, deleted= 0, no_dive= 0;
uid_t user= 0;
gid_t group= 0;
time_t date= 0;
@ -1861,15 +1885,7 @@ int Xorriso_findi_action(struct XorrisO *xorriso, struct FindjoB *job,
} else if(action == 38) { /* sort_weight */
iso_node_set_sort_weight(node, type);
} else if(action == 39) { /* hide */
hide_attrs= 0;
if(type) {
hide_attrs|= LIBISO_HIDE_BUT_WRITE;
if(type & 1)
hide_attrs|= LIBISO_HIDE_ON_RR;
if(type & 2)
hide_attrs|= LIBISO_HIDE_ON_JOLIET;
}
iso_node_set_hidden(node, hide_attrs);
Xorriso_set_hidden(xorriso, node, NULL, type, 0);
} else { /* includes : 15 in_iso */
sprintf(xorriso->result_line, "%s\n", Text_shellsafe(show_path, sfe, 0));
Xorriso_result(xorriso, 0);