* Added "progress bars".

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28424 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2008-11-01 12:51:20 +00:00
parent 2395e3a496
commit 617fdc096a
2 changed files with 14 additions and 2 deletions
@@ -116,7 +116,7 @@ FileList gFiles;
void
process_file(const file_entry& entry)
process_file(const file_entry& entry, int number)
{
struct stat stat;
if (::stat(entry.path.c_str(), &stat) != 0) {
@@ -146,6 +146,12 @@ process_file(const file_entry& entry)
if (memcmp(entry.hash, gSHA.Digest(), SHA_DIGEST_LENGTH))
fprintf(stderr, "\"%s\": Contents differ!\n", entry.path.c_str());
static bigtime_t sLastUpdate = -1;
if (system_time() - sLastUpdate > 500000) {
printf("%ld files scanned\33[1A\n", number);
sLastUpdate = system_time();
}
}
@@ -220,7 +226,7 @@ main(int argc, char** argv)
bigtime_t start = system_time();
for (int i = 0; i < fileCount; i++) {
process_file(gFiles[i]);
process_file(gFiles[i], i);
}
bigtime_t runtime = system_time() - start;
@@ -181,6 +181,12 @@ process_file(const char* path)
//printf("%s %s\n", entry.HashString().c_str(), path);
gFiles.push_back(entry);
static bigtime_t sLastUpdate = -1;
if (system_time() - sLastUpdate > 500000) {
printf("%ld files scanned\33[1A\n", gFiles.size());
sLastUpdate = system_time();
}
}