Author Topic: uFileSystem read/write  (Read 6376 times)

Offline neil

  • Sr. Member
  • ****
  • Posts: 438
    • View Profile
uFileSystem read/write
« on: November 26, 2010, 07:51:37 PM »
Hi Mark,
  I would like to read/write to the uFileSystem using atmel exernal memory, is it possible to overwrite parts of the file?

Thanks
Neil

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: uFileSystem read/write
« Reply #1 on: November 26, 2010, 09:07:10 PM »
Hi Neil

The uFileSystem interface doesn't allow overwriting parts of a file. It is necessary to write the complete file again with the changes (this first automatically deleted the file before writing the new content). If you have space, you can use two files - write the new contant to the second file and then deleted the original one (reversing the sequence each time) - this ensures that you can't lose content of there is a crash or power-cycle during the process.

Regards

Mark