charlesbaynham / OSFS

Overly Simplified File System for Arduino EEPROM
GNU General Public License v3.0
33 stars 9 forks source link

Overwriting with a larger file? #2

Closed ferchinas closed 4 years ago

ferchinas commented 5 years ago

Hello: Very interesting your library, congratulations. I need this same but with support for "Overwriting with a larger file" do you plan to add it? Thank you

charlesbaynham commented 5 years ago

Hi! That's something that I'd like to implement at some point. There are really two options for how to do this:

  1. Search for a piece of continuous space, delete the old file and save it in the new space instead.
  2. Allow fragmented files.

Option 1 is the easiest, and the current filesystem spec is designed to make this possible. It also fits with the "simple" ethos of this project. Option 2 is more flexible and uses space more efficiently, but would require a change to the spec and some more code / complexity.

Given that the type of files I tend to store are very small compared to the amount of space available, efficiency is normally not a concern for me, so I'd tend to favour simplicity. For that reason I think option 1 is the better way to go.

One day I'll implement it, but probably not soon. If you'd like to have a go yourself then you're very welcome!

charlesbaynham commented 4 years ago

@ferchinas the day has finally come! V1.2 now supports overwriting with larger files.

ferchinas commented 4 years ago

Hi @charlesbaynham
It is very good to hear this. So knowing that it is available now, I am going to start using EEPROM! I'll give it a try and come back with comments. Thank you very much for the news