After the filesystem runs out of space the filesystem doesn't appear to remove files correctly
microbit-sam opened this issue · comments
http://python-editor-parallax-filesystem-review.microbit.org.s3-eu-west-1.amazonaws.com/editor.html#
- Add a a large file to the filesystem
- Click download
- This will append main.py to the filesystem
- Oops out of memory will appear
- Check
microbitFs
in console
Refresh, and with the same program
- Click download
- This will append main.py to the filesystem
- This will download correctly
- Check
microbitFs
in console
For both the only file in files should be main.py
Is FS_NEXT_AVAILABLE_CHUNK not being reset when the oversized file is removed
var FS_START_CHUNK = 0x01;
var FS_NEXT_AVAILABLE_CHUNK = FS_START_CHUNK;
function fsIncreaseChunkIndex(numberOfChunks) {
FS_NEXT_AVAILABLE_CHUNK += numberOfChunks;
var unusedMap = new MemoryMap();
// Check if we are over the filesystem area
if (chuckIndexAddress(unusedMap, FS_NEXT_AVAILABLE_CHUNK) >=
getEndAddress(unusedMap)) {
throw new Error('There is no more space in the file system.');
}
}
Yes, this was indeed an issue due to the temporary code with magic numbers and fake chunk discovery.
This has been fixed in 310a71d.