Talk:Proposal: Earlier Disk Over-run Warnings

From Audacity Wiki
Revision as of 15:56, 15 April 2016 by PeterSampson (talk | contribs) (steve's next comment)
Jump to: navigation, search

Steve 14Apr16 I'd guess that what we need is 'one' piece of code that tests for disk space, 'one' piece of code that handles the error, then multiple places where the test is called.

The "test" needs to be available and sufficiently flexible to work in all cases. For example, when generating a sound from a built-in effect we know in advance (almost) exactly how much space will be required, but when generating from a Nyquist effect we have no idea until Nyquist returns the data, and when recording we only know the rate at which data is written.

Getting the "test" and "error handling" to work correctly is the major task and imo should be the subject of bug 437.

Additional (smaller) bugs can then be raised for each additional situation where running out of disk space may occur, and fixing these should be relatively easy once the code for testing and error handling is in place. For example, it may be appropriate to enable calling the test periodically from ProgressDialog.

Steve 14Apr16 Skimming Ed's old patch, it looks like he was trying to deal with the case: "write to disk has failed - stop now and deal with it". I think this is an important safety mechanism, but in most cases it would be best to catch "Not enough room for requested action" _before_the attempt to write is made.

For example, if the user attempts to generate 4 hours of stereo sound when they only have enough space to generate 3 hours 59 minutes, it would be better to catch that before we start generating.

Also, let's not try to use ALL of the available disk space. If the user is critically low on disk space (only a few tens of MB), then let's stop there and tell the user they need more space. Some other application or process could easily eat up the last bit of free space, causing the computer to crash and put the blame on Audacity. Best if we provide some protection against that.