Count directories as 4096bytes

This commit is contained in:
TheFloW 2016-10-25 10:43:10 +02:00
parent 91ff45969b
commit 76bc048937
7 changed files with 13 additions and 12 deletions

View File

@ -217,7 +217,7 @@ int extractArchivePath(char *src, char *dst, FileProcessParam *param) {
if (param) {
if (param->value)
(*param->value)++;
(*param->value) += DIRECTORY_SIZE;
if (param->SetProgress)
param->SetProgress(param->value ? *param->value : 0, param->max);

2
file.c
View File

@ -433,7 +433,7 @@ int copyPath(char *src_path, char *dst_path, FileProcessParam *param) {
if (param) {
if (param->value)
(*param->value)++;
(*param->value) += DIRECTORY_SIZE;
if (param->SetProgress)
param->SetProgress(param->value ? *param->value : 0, param->max);

3
file.h
View File

@ -24,7 +24,8 @@
#define MAX_SHORT_NAME_LENGTH 64
#define MAX_MOUNT_POINT_LENGTH 16
#define TRANSFER_SIZE 64 * 1024
#define DIRECTORY_SIZE (4 * 1024)
#define TRANSFER_SIZE (64 * 1024)
#define HOME_PATH "home"
#define DIR_UP ".."

View File

@ -254,7 +254,7 @@ int copy_thread(SceSize args_size, CopyArguments *args) {
goto EXIT;
// Update thread
thid = createStartUpdateThread(size + folders);
thid = createStartUpdateThread(size + folders * DIRECTORY_SIZE);
// Copy process
uint64_t value = 0;
@ -267,7 +267,7 @@ int copy_thread(SceSize args_size, CopyArguments *args) {
FileProcessParam param;
param.value = &value;
param.max = size + folders;
param.max = size + folders * DIRECTORY_SIZE;
param.SetProgress = SetProgress;
param.cancelHandler = cancelHandler;

View File

@ -182,7 +182,7 @@ int zipAddFolder(zipFile zf, char *path, int filename_start, FileProcessParam *p
if (param) {
if (param->value)
(*param->value)++;
(*param->value) += DIRECTORY_SIZE;
if (param->SetProgress)
param->SetProgress(param->value ? *param->value : 0, param->max);
@ -305,7 +305,7 @@ int compress_thread(SceSize args_size, CompressArguments *args) {
goto EXIT;
// Update thread
thid = createStartUpdateThread(size + folders);
thid = createStartUpdateThread(size + folders * DIRECTORY_SIZE);
// Remove process
uint64_t value = 0;
@ -317,7 +317,7 @@ int compress_thread(SceSize args_size, CompressArguments *args) {
FileProcessParam param;
param.value = &value;
param.max = size;
param.max = size + folders * DIRECTORY_SIZE;
param.SetProgress = SetProgress;
param.cancelHandler = cancelHandler;

View File

@ -272,14 +272,14 @@ int update_extract_thread(SceSize args, void *argp) {
getArchivePathInfo(src_path, &size, &folders, &files);
// Update thread
thid = createStartUpdateThread(size + folders);
thid = createStartUpdateThread(size + folders * DIRECTORY_SIZE);
// Extract process
uint64_t value = 0;
FileProcessParam param;
param.value = &value;
param.max = size + folders;
param.max = size + folders * DIRECTORY_SIZE;
param.SetProgress = SetProgress;
param.cancelHandler = cancelHandler;

View File

@ -505,14 +505,14 @@ int install_thread(SceSize args_size, InstallArguments *args) {
goto EXIT;
// Update thread
thid = createStartUpdateThread(size + folders);
thid = createStartUpdateThread(size + folders * DIRECTORY_SIZE);
// Extract process
uint64_t value = 0;
FileProcessParam param;
param.value = &value;
param.max = size + folders;
param.max = size + folders * DIRECTORY_SIZE;
param.SetProgress = SetProgress;
param.cancelHandler = cancelHandler;