Re: Yet another [Un]Zip behavior quirk. Non-stupid opinions sought.

From: Craig A. Berry (craigberry_at_mac.com.spamfooler)
Date: 11/24/04


Date: Wed, 24 Nov 2004 08:21:39 -0600

In article <04112400112152@antinode.org>, sms@antinode.org wrote:

> With my changes, files extracted from non-V archives will, for the
> first time, be fully allocated at once, instead of incrementally. I
> fail to see how this wrecks anything.

It doesn't, and I'm glad to hear that's what we're talking about. Your
original post was mostly about how bothersome pre-allocation was when
unzipping -V archives for large files, and since most of the thread has
been about that case, I thought the discussion had moved toward
changing that behavior rather than adding it for the non-V case.

> > The fact that you can't protect from something external whacking the
> > program doesn't mean you shouldn't preserve the existing modest
> > precautions against exceeding disk quota or filling up the disk. Maybe
> > the exception handling is good enough that it will delete an incomplete
> > file regardless of the reason for incompleteness, but that's something
> > worth testing for if you go ahead and give it a couple more possible
> > reasons.
>
> Other than the initial larger allocation causing the error sooner, I
> fail to see any difference from the previous behavior.

> To what "existing modest precautions against exceeding disk quota or
> filling up the disk" do you refer? So far as I know, these programs try
> to make files and either succeed or fail. We ain't got no precautions.
> We don't need no precautions. I don't have to show you any _stinking_
> precautions!

It's pretty simple. An unexpected failure that leaves a partial file
on disk is more dangerous than an unexpected failure that leaves no
file at all on disk. If the exception handling and clean-up code are
good enough, the former case never happens. It's just simpler and more
robust to get the bad news at file creation time rather than depending
on clean-up code later on. But since you're keeping pre-allocation for
the -V case and adding it for the others, you're improving things by
this measure, and I have no argument with you.



Relevant Pages

  • Re: Format a hard drive on a VS4000 VLC
    ... > trying to format mine, and was getting an 84 fail myself, but as far as I ... with messages that sounded like the disk wasn't any ... The next one worked right the first time. ...
    (comp.sys.dec)
  • Re: File Merge
    ... You cannot know what happened until it actually happens -- so the only way to know that you have reached end-of-input is to try to read something and get a failure. ... might fail: for example, input from a disk could fail in the event of a head crash, or input from a keyboard could fail if you spilled Coke Classic into the mechanism and shorted it out with caramelized sugar. ... Most of C's input functions report a kind of "generalized failure" no matter what the cause -- and the *only* reason feof() exists is to let you figure out that cause. ...
    (comp.lang.c)
  • Re: ext2/3: document conditions when reliable operation is possible
    ... +during write, filesystems can't handle that correctly, because success ... and all we can do is fail. ... And here we're talking about ext2. ... Sounds like broken disk, then. ...
    (Linux-Kernel)
  • Re: [Question] Does the kernel ignore errors writng to disk?
    ... > as if the kernel may be ignoring write errors to disk. ... will fail with a time-out. ... File data gets flushed to a queue. ... You can observe the behavior by mounting a floppy disk and ...
    (Linux-Kernel)
  • Re: SQL 2000 extra instance into same group
    ... There is a trace flag that will disable the disk dependency check, ... If you had multiple instances running in the same resource group, ... If one were to fail, ... Every instance requires its own group/disk/IP/networkname in a cluster. ...
    (microsoft.public.sqlserver.clustering)