claudiodangelis / qrcp

:zap: Transfer files over wifi from your computer to your mobile device by scanning a QR code without leaving the terminal.
https://qrcp.sh
MIT License
9.89k stars 524 forks source link

Fixing deleting temp files and incorrect zip file #318

Closed vincenzoAiello closed 7 months ago

vincenzoAiello commented 7 months ago

This could fix the issue with the incorrect zip files (#317) and the delete of the temporary zip files in Windows (#277).

To fix the incorrect zip compression i reuse the archivex library (like it was done at the beginning) but for fixing the delete of the temporary zip files in Windows, i use the "CreateWriter" function in order to close, at the end of function, the writer and the file.

claudiodangelis commented 7 months ago

Thanks for this! Are you able to reproduce the original zip issue on Windows?

vincenzoAiello commented 7 months ago

Yes,sure. If we use the compression method without library and we send a directory like this

esempioDir the zip file received on the phone through qrcp, will be incorrect photo_2023-12-20_18-00-49

With the new method the zip file will be correct

photo_2023-12-20_17-54-26 photo_2023-12-20_17-54-26 (2) photo_2023-12-20_17-54-26 (3)

If we send the same zip file on windows though qrcp, it will appear correctly.

zip1 zip2 zip3

During the sending, the temporary files error, will not be present beacause the file is closed successfully

image

claudiodangelis commented 7 months ago

Perfect, and are you able to reproduce the issue with 0.10.1 where the tool panics after sending the zip? If so, can you confirm the issue is gone with your new patch? If everything is working, we can release 0.11.1 tomorrow. Thanks! C

vincenzoAiello commented 7 months ago

Yes, in the 0.10.1 version when i try to send a file and It Is received, It shows an error about the delete of temporary zip file. This issue Is gone with this patch. Do you need some screenshot?

claudiodangelis commented 7 months ago

Thanks for the prompt response! No screenshot required, just wanted to double check this with you before releasing. Grazie!