On 2020-02-01, at 11:48 AM, David T. Lewis lewis@mail.msen.com wrote:
That's a good idea, and on a unix platform we can use statvfs() to check space availability without adding any disc traffic.
The way we used to do this on RISC OS was (is, for the remaining users!) to allocate a file of the required size and it would be filled with 0. That way if you got a success return code you knew for certain (barring fire, flood, bomb or bear attack) that the file could be over-written with your real content. Do any other filing systems actually really definitely allocate space when you ask for it? No idea.
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Strange OpCodes: FR: Flip Record