* Added "progress bars".
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28424 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -116,7 +116,7 @@ FileList gFiles;
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
process_file(const file_entry& entry)
|
process_file(const file_entry& entry, int number)
|
||||||
{
|
{
|
||||||
struct stat stat;
|
struct stat stat;
|
||||||
if (::stat(entry.path.c_str(), &stat) != 0) {
|
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))
|
if (memcmp(entry.hash, gSHA.Digest(), SHA_DIGEST_LENGTH))
|
||||||
fprintf(stderr, "\"%s\": Contents differ!\n", entry.path.c_str());
|
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();
|
bigtime_t start = system_time();
|
||||||
|
|
||||||
for (int i = 0; i < fileCount; i++) {
|
for (int i = 0; i < fileCount; i++) {
|
||||||
process_file(gFiles[i]);
|
process_file(gFiles[i], i);
|
||||||
}
|
}
|
||||||
|
|
||||||
bigtime_t runtime = system_time() - start;
|
bigtime_t runtime = system_time() - start;
|
||||||
|
|||||||
@@ -181,6 +181,12 @@ process_file(const char* path)
|
|||||||
//printf("%s %s\n", entry.HashString().c_str(), path);
|
//printf("%s %s\n", entry.HashString().c_str(), path);
|
||||||
|
|
||||||
gFiles.push_back(entry);
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user