hrrmsn / ffcleaner

cmd tool to cleanup littered directories (Files&Folders cleaner)
0 stars 0 forks source link

Incorrect display current progress value when copying big files #36

Closed hrrmsn closed 7 years ago

hrrmsn commented 7 years ago

Test case is below. (Content of the log file.)

[2017-17-02 13:10:20] Start logging.
[2017-17-02 13:10:20] OS is Windows.
[2017-17-02 13:10:20] Platform info: Windows-XP-5.1.2600-SP3.
[2017-17-02 13:10:20] Launch command: E:\!Plan9\dev\languages\python\ffcleaner\ffcleaner.py --todir h:\01\photos_cleaned h:\01\photos-from-self-dev.
[2017-17-02 13:10:20] Dir to output: 'h:\01\photos_cleaned'.
[2017-17-02 13:10:20] Dir to clean: 'h:\01\photos-from-self-dev'.
[2017-17-02 13:10:20] Counting files to clean...
[2017-17-02 13:10:20] 1 files found.
[2017-17-02 13:10:20] Started cleaning.
[2017-17-02 13:10:20] 100% complete
[2017-17-02 13:11:39] Processed files: 1.
[2017-17-02 13:11:39] Unknown files: 0.00%.
[2017-17-02 13:11:39] Unknown extensions are not found.
[2017-17-02 13:11:39] Cleaned in 1 min 19 sec.
[2017-17-02 13:11:39] End logging.

I would see a real progress value when big files are copying. Something like this.

[2017-17-02 13:10:20] 1 files found.
[2017-17-02 13:10:20] Started cleaning.
[2017-17-02 13:10:20] 10% complete
[2017-17-02 13:10:25] 34% complete
[2017-17-02 13:10:31] 67% complete
[2017-17-02 13:10:39] 100% complete
[2017-17-02 13:11:40] Processed files: 1.
[2017-17-02 13:11:40] Unknown files: 0.00%.
[2017-17-02 13:11:40] Unknown extensions are not found.
hrrmsn commented 7 years ago

I had played a little with a binary IO operation in python and i think that it's possible to create an own function for file copying. (Or something similar.)

hrrmsn commented 7 years ago

I created copybytes function that copies file byte-by-byte if the file size more than 1 megabyte.

hrrmsn commented 7 years ago

DONE.