static bool dot_ls_cmd(UAContext *ua, const char *cmd);
static bool dot_bvfs_lsdirs(UAContext *ua, const char *cmd);
static bool dot_bvfs_lsfiles(UAContext *ua, const char *cmd);
-static bool dot_bvfs_ls_all_files(UAContext *ua, const char *cmd);
static bool dot_bvfs_update(UAContext *ua, const char *cmd);
static bool dot_bvfs_get_jobids(UAContext *ua, const char *cmd);
static bool dot_bvfs_versions(UAContext *ua, const char *cmd);
{ NT_(".actiononpurge"),aopcmd, NULL, true},
{ NT_(".bvfs_lsdirs"), dot_bvfs_lsdirs, NULL, true},
{ NT_(".bvfs_lsfiles"),dot_bvfs_lsfiles, NULL, true},
- { NT_(".bvfs_ls_all_files"),dot_bvfs_ls_all_files, NULL, true},
{ NT_(".bvfs_get_volumes"),dot_bvfs_get_volumes,NULL, true},
{ NT_(".bvfs_update"), dot_bvfs_update, NULL, true},
{ NT_(".bvfs_get_jobids"), dot_bvfs_get_jobids, NULL, true},
}
/*
- * .bvfs_lsfiles jobid=1,2,3,4 pathid=10
- * .bvfs_lsfiles jobid=1,2,3,4 path=/
+ * .bvfs_lsfiles allfiles jobid=1,2,3,4
*/
-static bool dot_bvfs_lsfiles(UAContext *ua, const char *cmd)
+static bool dot_bvfs_ls_all_files(UAContext *ua, const char *cmd)
{
- DBId_t pathid=0;
int limit=2000, offset=0;
- char *path=NULL, *jobid=NULL, *username=NULL;
+ char *jobid=NULL, *username=NULL;
char *pattern=NULL, *filename=NULL;
- bool ok;
int i;
- if (!bvfs_parse_arg(ua, &pathid, &path, &jobid, &username,
+ if (!bvfs_parse_arg(ua, NULL, NULL, &jobid, &username,
&limit, &offset))
{
- ua->error_msg("Can't find jobid, pathid or path argument\n");
+ ua->error_msg("Can't find jobid argument\n");
return true; /* not enough param */
}
if ((i = find_arg_with_value(ua, "pattern")) >= 0) {
if (filename) {
fs.set_filename(filename);
}
- if (pathid) {
- ok = fs.ch_dir(pathid);
- } else {
- ok = fs.ch_dir(path);
- }
- if (!ok) {
- goto bail_out;
- }
fs.set_offset(offset);
- fs.ls_files();
+ fs.ls_all_files();
bail_out:
ua->bvfs = NULL;
}
/*
- * .bvfs_ls_all_files jobid=1,2,3,4
+ * .bvfs_lsfiles jobid=1,2,3,4 pathid=10
+ * .bvfs_lsfiles jobid=1,2,3,4 path=/
*/
-static bool dot_bvfs_ls_all_files(UAContext *ua, const char *cmd)
+static bool dot_bvfs_lsfiles(UAContext *ua, const char *cmd)
{
+ DBId_t pathid=0;
int limit=2000, offset=0;
- char *jobid=NULL, *username=NULL;
+ char *path=NULL, *jobid=NULL, *username=NULL;
char *pattern=NULL, *filename=NULL;
+ bool ok;
int i;
- if (!bvfs_parse_arg(ua, NULL, NULL, &jobid, &username,
+ if (find_arg(ua, "allfiles") > 0) {
+ return dot_bvfs_ls_all_files(ua, cmd);
+ }
+
+ if (!bvfs_parse_arg(ua, &pathid, &path, &jobid, &username,
&limit, &offset))
{
- ua->error_msg("Can't find jobid argument\n");
+ ua->error_msg("Can't find jobid, pathid or path argument\n");
return true; /* not enough param */
}
if ((i = find_arg_with_value(ua, "pattern")) >= 0) {
if (filename) {
fs.set_filename(filename);
}
+ if (pathid) {
+ ok = fs.ch_dir(pathid);
+ } else {
+ ok = fs.ch_dir(path);
+ }
+ if (!ok) {
+ goto bail_out;
+ }
fs.set_offset(offset);
- fs.ls_all_files();
+ fs.ls_files();
bail_out:
ua->bvfs = NULL;