-
-
Notifications
You must be signed in to change notification settings - Fork 116
Initial file gets cached and not deleted after compression #168
Comments
Thank you @chaniotisalex for pointing this out. I have fixed the issue. |
I'm also having this issue. My app size is now 8GB on my device. The only way for me to reduce it is to "clear data" which would also delete all other data related to the app and essentially reduce it to a fresh install. I would suggest that you probably shouldn't store any files in this location at all. If you need to cache a temporary file you could use cacheDir and File.createTempFile: https://developer.android.com/training/data-storage/app-specific#internal-create-cache .. One thing to consider here is if the app process is killed in the middle of the compression job will the file still be deleted/deletable. If you use the cacheDir it will be. The system or the user can clear the cache for the app at any point without affecting the proper functioning of the app. If you put temporary files in the root data directory and the app is killed before it gets chance to delete that file, the opportunity is lost and it will be stuck there until the user clears all data for the app. |
It would be great if we could just pass in a full path for the output file. The old version used to do that. By passing in a full path to a file, the developer could specify if they want to save it to the private caches folder, permanent storage, etc. Right now, everything goes into the files directory. |
Open pull request #182 to fix this problem and make more flexible library @AbedElazizShe |
Same issue. Not fixed in 1.3.2 |
The problem described by the author persists in version 1.3.3. Additional information: |
When the lib retrieves the file in order to compress it, it caches it inside
/data/user/0/com.your.project.package/
. After compression is complete, the file doesn't get deleted, leaving a file which only has a name in form of currentTimeMillis and the size of the initial file.The text was updated successfully, but these errors were encountered: