Track backup and restore progress
Track backup and restore progress based on the sizes of the files
as they are being added to the tar backup file. Update the
progress bar based on the sizes of the files.
Change-Id: Idf649efa1db3e91830b4b2add86203a3f30042ff
diff --git a/twrpTarMain/twrpTarMain.cpp b/twrpTarMain/twrpTarMain.cpp
index b28a42e..c1705c7 100644
--- a/twrpTarMain/twrpTarMain.cpp
+++ b/twrpTarMain/twrpTarMain.cpp
@@ -47,6 +47,7 @@
int i, action = 0;
unsigned j;
string Directory, Tar_Filename;
+ unsigned long long temp1 = 0, temp2 = 0;
#ifndef TW_EXCLUDE_ENCRYPTED_BACKUPS
string Password;
#endif
@@ -142,14 +143,14 @@
}
#endif
if (action == 1) {
- if (tar.createTarFork() != 0) {
+ if (tar.createTarFork(&temp1, &temp2) != 0) {
sync();
return -1;
}
sync();
printf("\n\ntar created successfully.\n");
} else if (action == 2) {
- if (tar.extractTarFork() != 0) {
+ if (tar.extractTarFork(&temp1, &temp2) != 0) {
sync();
return -1;
}