Recent

Author Topic: [SOLVED] unzipping a file gives no error when harddisk is full  (Read 4340 times)

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: [SOLVED] unzipping a file gives no error when harddisk is full
« Reply #15 on: September 14, 2019, 09:12:41 pm »
Hi
!


But let us remember that this Zip version works only with the old Zip format  < 4 GB.
It will fail with the new version with the maximum of 16 Exabyte.

There should be a notice in the doc file.

Winni

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1106
Re: unzipping a file gives no error when harddisk is full
« Reply #16 on: September 20, 2019, 02:42:56 pm »
@valdir.marcos:
Thank you very much for creating a bug report in https://bugs.freepascal.org/view.php?id=36068
The bug has been fixed after a few hours.
I have verified the fix and it works.
But I can't add a Note to the bug report nor close it. Maybe I don't have the rights to do this (I am only a "reporter").
Can you add a note and close the report?
Text could be: The fix has been verified by Hartmut with Revision 42985 on Windows 7. Now if the disk is full during unzipping an Exception "Stream write error" is raised. The bug has been fixed. Thanks for fixing.
I don't think it's necessary since the ticket is already closed.

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1106
Re: [SOLVED] unzipping a file gives no error when harddisk is full
« Reply #17 on: September 20, 2019, 02:44:31 pm »
Hi!
But let us remember that this Zip version works only with the old Zip format  < 4 GB.
It will fail with the new version with the maximum of 16 Exabyte.
There should be a notice in the doc file.
Winni
Have you already filed a bug report about documentation?

wp

  • Hero Member
  • *****
  • Posts: 11831
Re: unzipping a file gives no error when harddisk is full
« Reply #18 on: September 20, 2019, 04:05:09 pm »
the ticket is already closed.
No it is not, it is only "resolved", i.e. the developer solved the issue either by fixing it himself, by apply a patch, or by discarding it. Now it's your turn as reporter to "close" the issue, i.e. you do the final test and verify that the issue really is solved. A "closed" issue is removed from most of the bugtracker lists which helps the developers by thinning out the bug lists. If you don't agree that the issue is solved you can re-open it by clicking on the "Reopen" button (this can happen even after you "closed" the ticket and discover later that the issue still exists under some circumstances.)

BTW, I would not close this particular issue because it does not consider the argument brought in by sstvmaster (reply #10): The unzipper should check the available disk space *before* beginning to write to disk. The current solution allows to write gigabytes to the HD and notice only at the end that the disk is overrunning. I think Michael was not aware of this aspect when resolving the issue. At least it should be brought to his attention to make him reconsider his solution.

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1106
Re: unzipping a file gives no error when harddisk is full
« Reply #19 on: September 20, 2019, 05:01:57 pm »
the ticket is already closed.
No it is not, it is only "resolved", i.e. the developer solved the issue either by fixing it himself, by apply a patch, or by discarding it. Now it's your turn as reporter to "close" the issue, i.e. you do the final test and verify that the issue really is solved. A "closed" issue is removed from most of the bugtracker lists which helps the developers by thinning out the bug lists. If you don't agree that the issue is solved you can re-open it by clicking on the "Reopen" button (this can happen even after you "closed" the ticket and discover later that the issue still exists under some circumstances.)
Thanks for your information.
I thought it was closed because of a new menu option to "Reopen" (Reabrir) (image attached) appeared and no way to add more information on Activities panel.

Quote
BTW, I would not close this particular issue because it does not consider the argument brought in by sstvmaster (reply #10): The unzipper should check the available disk space *before* beginning to write to disk. The current solution allows to write gigabytes to the HD and notice only at the end that the disk is overrunning. I think Michael was not aware of this aspect when resolving the issue. At least it should be brought to his attention to make him reconsider his solution.
I will reopen the ticket and write down all this extra information.
Thanks again.

PascalDragon

  • Hero Member
  • *****
  • Posts: 5444
  • Compiler Developer
Re: unzipping a file gives no error when harddisk is full
« Reply #20 on: September 21, 2019, 12:03:12 pm »
BTW, I would not close this particular issue because it does not consider the argument brought in by sstvmaster (reply #10): The unzipper should check the available disk space *before* beginning to write to disk. The current solution allows to write gigabytes to the HD and notice only at the end that the disk is overrunning. I think Michael was not aware of this aspect when resolving the issue. At least it should be brought to his attention to make him reconsider his solution.
I don't agree here. It should be up to the application to decide whether it wants to prohibit extracting to a volume without enough free space or not (e.g. there could be a valid case that one extracts something while deleting something else at the same time).
Not to mention that the SysUtils.DiskFree function might not return something useful on all systems.

sstvmaster

  • Sr. Member
  • ****
  • Posts: 299
Re: unzipping a file gives no error when harddisk is full
« Reply #21 on: September 21, 2019, 07:47:31 pm »
I don't agree here. It should be up to the application to decide whether it wants to prohibit extracting to a volume without enough free space or not
Shure, the App could do that.

(e.g. there could be a valid case that one extracts something while deleting something else at the same time).
OK, but i never saw something like this.

Not to mention that the SysUtils.DiskFree function might not return something useful on all systems.
Then the developer should solve this problem.
greetings Maik

Windows 10,
- Lazarus 2.2.6 (stable) + fpc 3.2.2 (stable)
- Lazarus 2.2.7 (fixes) + fpc 3.3.1 (main/trunk)

jamie

  • Hero Member
  • *****
  • Posts: 6077
Re: [SOLVED] unzipping a file gives no error when harddisk is full
« Reply #22 on: September 21, 2019, 10:43:19 pm »
Maybe at least  property to report the required space could be in order?
The only true wisdom is knowing you know nothing

sstvmaster

  • Sr. Member
  • ****
  • Posts: 299
Re: [SOLVED] unzipping a file gives no error when harddisk is full
« Reply #23 on: September 22, 2019, 12:33:40 am »
This could be a solution:
Code: Pascal  [Select][+][-]
  1. --- C:/lazarus/fpc/3.0.4/source/packages/paszlib/src/zipper.pp  Sat Sep 21 23:55:13 2019
  2. +++ C:/Users/Ich/Desktop/ZipperSizeUncompressed/zipper.pp       Sun Sep 22 00:18:14 2019
  3. @@ -493,0 +494 @@
  4. +    FUnzippedSize: Int64;
  5. @@ -549,0 +551 @@
  6. +    Property UnZippedSize: Int64 Read FUnZippedSize;
  7. @@ -2334,0 +2337,8 @@
  8. +
  9. +  // Unzipped size of file
  10. +  FUnzippedSize := 0;
  11. +  for i:=0 to FEntries.Count - 1 do
  12. +  begin
  13. +    Inc(FUnZippedSize, FEntries.Entries[i].Size);
  14. +  end;
  15. +
  16.  

This is a diff against fpc 3.0.4.
greetings Maik

Windows 10,
- Lazarus 2.2.6 (stable) + fpc 3.2.2 (stable)
- Lazarus 2.2.7 (fixes) + fpc 3.3.1 (main/trunk)

jamie

  • Hero Member
  • *****
  • Posts: 6077
Re: [SOLVED] unzipping a file gives no error when harddisk is full
« Reply #24 on: September 22, 2019, 01:00:10 am »
yes, looks good..
The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018