/*
* Send a include list with only one directory and recurse=no
*/
-bool send_ls_fileset(JCR *jcr, const char *path)
+bool send_ls_fileset(JCR *jcr, const char *path, bool dironly)
{
BSOCK *fd = jcr->file_bsock;
fd->fsend(filesetcmd, "" /* no vss */, "" /* no snapshot */);
fd->fsend("I\n");
- fd->fsend("O h\n"); /* Limit recursion to one directory */
+ if (dironly) { /* Display only directories */
+ fd->fsend("O eh\n"); /* Limit recursion to one directory */
+ fd->fsend("WF *\n");
+
+ } else {
+ fd->fsend("O h\n"); /* Limit recursion to one directory */
+ }
fd->fsend("N\n");
fd->fsend("F %s\n", path);
fd->fsend("N\n");
/* fd_cmds.c */
extern int connect_to_file_daemon(JCR *jcr, int retry_interval,
int max_retry_time, int verbose);
-extern bool send_ls_fileset(JCR *jcr, const char *path);
+extern bool send_ls_fileset(JCR *jcr, const char *path, bool dironly);
extern bool send_ls_plugin_fileset(JCR *jcr, const char *plugin, const char *path);
extern bool send_include_list(JCR *jcr);
extern bool send_exclude_list(JCR *jcr);
{ NT_(".bvfs_delete_fileid"),dot_bvfs_delete_fileid, NULL, NULL, false},
{ NT_(".setuid"), dot_setuid, _("Set UID/GID for the current session"), ".setuid uid=<uid> gid=<gid>", false},
{ NT_(".ls"), dot_ls_cmd, _("List files/directories on Client"),
- ".ls client=<cli> path=<str> [plugin=<str>]", false},
+ ".ls client=<cli> path=<str> [dironly] [plugin=<str>]", false},
{ NT_(".types"), typescmd, _("List Job Types defined"), NULL, false},
{ NT_(".query"), dot_querycmd, _("Query Plugin's Client"),
".query client=<cli> plugin=<str> parameter=<str>", false},
JCR *jcr = ua->jcr;
int i;
bool ret = false;
+ bool dironly = false;
jcr->setJobLevel(L_FULL);
i = find_arg_with_value(ua, NT_("client"));
return false;
}
+ i = find_arg(ua, NT_("dironly"));
+ if (i > 0) {
+ dironly = true;
+ }
+
/* optional plugin=... parameter */
i = find_arg_with_value(ua, NT_("plugin"));
if (i > 0) {
goto bail_out;
}
} else {
- if (!send_ls_fileset(jcr, path)) {
+ if (!send_ls_fileset(jcr, path, dironly)) {
ua->error_msg(_("Failed to send command to Client.\n"));
goto bail_out;
}