stefankueng / CryptSync

CryptSync is a small utility that synchronizes two folders while encrypting the contents in one folder. That means one of the two folders has all files unencrypted (the files you work with) and the other folder has all the files encrypted.
https://tools.stefankueng.com/CryptSync.html
GNU General Public License v3.0
398 stars 72 forks source link

Slow unpack read-only files #92

Closed Argimko closed 1 year ago

Argimko commented 1 year ago

Hello Stefan, thank you for your very useful tool!

I just found a bug, I think.

Lets assume you have 20 small text files at SOURCE folder: 10 file with set attribute read-only, and 10 files without this attribute.

So, lets encrypt this with the command:

"%PROGRAMW6432%\CryptSync\CryptSync.exe" /src:"SOURCE" /dst:"ENCRYPTED" /pw:"PASSWORD" /mirror /progress

So it is OK, it works fast.

Now, lets clean up folder SOURCE and run the next command:

"%PROGRAMW6432%\CryptSync\CryptSync.exe" /src:"SOURCE" /dst:"ENCRYPTED" /pw:"PASSWORD" /mirrorback /progress /logpath:"PATH_TO_LOG"

So you will see that files without attribute read-only unpack very fast, but files with read-only attribute unpacking about 10 times slowly. Also you will find at log-file, errors for read-only files:

ERROR: failed to set file time on D:\Desktop\from\1.txt

I would be very grateful to you if you can speed up unpack operation by fixing setting file time for read-only files.

Thank you!

I used CryptSync v1.4.3.446 on Windows 10 v21H2

stefankueng commented 1 year ago

this is already improved. See the #if 0 section here: https://github.com/stefankueng/CryptSync/blob/main/src/FolderSync.cpp#L1204

That section was responsible for the slow unpack.