Ta©ti_Tac0Z, on 13 August 2018 - 01:34 PM, said:
any way of looking into a file handle and see how many bytes is in the buffer?
Not really. You can assume it's empty after flushing, though.
Ta©ti_Tac0Z, on 13 August 2018 - 01:34 PM, said:
am getting a little issue:
the spaceE never gets set to true
and no sound is ever played
Your code only ever checks the available free space once. If you want to check it multiple times, then you need to call fs.getFreeSpace() multiple times. The value recorded in Lfree isn't going to automatically update.
In cases where drive size is an issue, you might consider increasing it through
ComputerCraft.cfg - personally I've got it cranked up to the maximum, roughly a gig per computer.
If you're playing on a server and can't do that, then you may find
BBPack to be useful. Among other things, it can compress your whole filesystem, which typically allows for much more storage. To set this up, add os.loadAPI("bbpack") to the top of your startup file, then enter "bbpack compress" at the command line.