On Jun 30 13:00, Christopher Faylor wrote: > On Sun, Jun 30, 2013 at 11:45:24AM +0200, Corinna Vinschen wrote: > >On Jun 29 16:33, Christopher Faylor wrote: > >> I keep cygwin on a partition which is relatively small. So, today for > >> at least the third time, I've run into problems where setup was unable > >> to extract files because I'd run out of disk space (I had started to > >> install the 64-bit installation on the same disk, thought better of it, > >> and forgotten to clean up after myself). The errors represented as > >> in-use problems. That was clearly wrong. I thought there was a setup > >> bug because it seemed to allow me to continue without error. It didn't > >> really. I kept continuing until eventually setup came to a hard stop > >> and my installation was hosed. > >> > >> What should setup do when it encounters a full disk? I think it should > >> probably give the user the option of freeing up disk space and > >> continuing but I think that's going to be difficult to do cleanly since > >> there are any number of places where you could run into this situation. > >> > >> Does anyone have any creative ideas about how to allow setup.exe to > >> cleanly handle out-of-disk-space errors? > > > >I don't see a simple way out, unless you make the installation > >process transactional as under yum. > > > >One simple way to handle that would be to add up the bytes of > >the packages to install (blocksize aligned) and to compare that > >with the number of bytes left on the disk. > > > >One even more easy way would be to show a warning every time the > >available disk space is less then 1 Gig. > > I think I was actually seeing the error on directory creation so > just adding up space wouldn't necessarily be sufficient.
It would give a pretty good indicator that you could run into problems if you proceed, though. Liberally add 100K for directory creation and you're good. > I was actually thinking of having some kind of exception when any file > I/O operation encounters an ERROR_DISK_FULL (or whatever it is). But, I > guess, if you are going to code that then you can just put a standard > check_for_disk_full() call after every operation. Ok, but you asked for a *clean* way to handle the problem. When the disk full error occurs, it's too late to handle it gracefully. A mechanism telling you early on that you might run into problems could be helpful. Other than that, you'd really need transactions to allow rolling back the broken update. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat