Skip to content

Commit

Permalink
Show file/folder being scanned in (before starting) multithreaded mod…
Browse files Browse the repository at this point in the history
…e, and don't bail out

on missing file/folders during the scanning phase.
  • Loading branch information
RJVB committed Jun 3, 2015
1 parent 5abd846 commit 5976a1d
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions afsctool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1644,10 +1644,8 @@ int afsctool (int argc, const char * argv[])
void *attr_buf;
UInt16 big16;
UInt64 big64;
#ifdef SUPPORT_PARALLEL
int nJobs = 0;
#endif


folderinfo.filetypeslist = NULL;
folderinfo.filetypeslistlen = 0;
folderinfo.filetypeslistsize = 0;
Expand Down Expand Up @@ -1925,7 +1923,7 @@ next_arg:;
if (lstat(fullpath, &fileinfo) < 0)
{
fprintf(stderr, "%s: %s\n", fullpath, strerror(errno));
return -1;
continue;
}

argIsFile = ((fileinfo.st_mode & S_IFDIR) == 0);
Expand All @@ -1940,7 +1938,7 @@ next_arg:;
{
dstIsFile = ((dstfileinfo.st_mode & S_IFDIR) == 0);
fprintf(stderr, "%s: %s already exists at this path\n", fullpath, dstIsFile ? "File" : "Folder");
return -1;
continue;
}

if (applycomp && argIsFile)
Expand Down Expand Up @@ -1980,7 +1978,7 @@ next_arg:;
if (afscFile == NULL)
{
fprintf(stderr, "%s: %s\n", fullpathdst, strerror(errno));
return -1;
continue;
}
else
{
Expand Down Expand Up @@ -2068,7 +2066,7 @@ next_arg:;
if (afscFile == NULL)
{
fprintf(stderr, "%s: %s\n", fullpathdst, strerror(errno));
return -1;
continue;
}
else
{
Expand All @@ -2089,7 +2087,7 @@ next_arg:;
if (outFile == NULL)
{
fprintf(stderr, "%s: %s\n", fullpathdst, strerror(errno));
return -1;
continue;
}
else
{
Expand Down Expand Up @@ -2152,7 +2150,7 @@ next_arg:;
if (lstat(fullpathdst, &dstfileinfo) < 0)
{
fprintf(stderr, "%s: %s\n", fullpathdst, strerror(errno));
return -1;
continue;
}
decompressFile(fullpathdst, &dstfileinfo);
}
Expand All @@ -2168,7 +2166,8 @@ next_arg:;
if ((currfolder = fts_open(folderarray, FTS_PHYSICAL, NULL)) == NULL)
{
fprintf(stderr, "%s: %s\n", fullpath, strerror(errno));
exit(EACCES);
// exit(EACCES);
continue;
}
while ((currfile = fts_read(currfolder)) != NULL)
{
Expand Down Expand Up @@ -2233,7 +2232,8 @@ next_arg:;
if ((currfolder = fts_open(folderarray, FTS_PHYSICAL, NULL)) == NULL)
{
fprintf(stderr, "%s: %s\n", fullpath, strerror(errno));
exit(EACCES);
// exit(EACCES);
continue;
}
folderinfo.uncompressed_size = 0;
folderinfo.uncompressed_size_rounded = 0;
Expand All @@ -2247,7 +2247,7 @@ next_arg:;
folderinfo.num_folders = 0;
folderinfo.num_hard_link_folders = 0;
folderinfo.print_info = printVerbose;
folderinfo.print_files = printDir;
folderinfo.print_files = (nJobs == 0)? printDir : 0;
folderinfo.compress_files = applycomp;
folderinfo.check_files = fileCheck;
folderinfo.allowLargeBlocks = allowLargeBlocks;
Expand All @@ -2264,7 +2264,14 @@ next_arg:;
if (printVerbose > 0 || !printDir)
{
if (printDir) printf("\n");
printf("%s:\n", fullpath);
if (!nJobs)
{
printf("%s:\n", fullpath);
}
else
{
printf("Adding %s to queue\n", fullpath);
}
if (folderinfo.filetypes != NULL)
{
alltypesinfo.filetype = NULL;
Expand Down

0 comments on commit 5976a1d

Please sign in to comment.