This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Edit file with RL-FlashFs

Hi, I'm using RL-FlashFs to create files in external memory with an LPC2478.

I am doing a kind of database with JSON and I need to add and exluir records within files. But I am not able to position the FILE pointer to the line that I want to delete / edit.

Have you tried using fseek but without success. I also tried to use the operator "+ r" for reading and updating, but then always returns a NULL pointer.

Does anyone have a solution so I can write and escluir lines in the middle of a file?

Parents
  • Good morning, thanks for the reply!
    I looked at the documentation that passed me, and also consulted on this link fopen (http://www.keil.com/support/man/docs/rlarm/rlarm_fopen.htm)

    The boot process and format the driver I'm doing, and at this point everything is ok. The problem occurs when I try to change the data of a file.

    What I'm trying to do is write in the middle of a file without erasing its contents. That's because I'm doing a database in memory NOR where the user can add, delete or edit the items in the table of DB.

    From what I gather mode "r+" can not be used to open a file because it is not supported by the library. In this case I am looking for a way where it can be done this type of operation so that I can create this database.

Reply
  • Good morning, thanks for the reply!
    I looked at the documentation that passed me, and also consulted on this link fopen (http://www.keil.com/support/man/docs/rlarm/rlarm_fopen.htm)

    The boot process and format the driver I'm doing, and at this point everything is ok. The problem occurs when I try to change the data of a file.

    What I'm trying to do is write in the middle of a file without erasing its contents. That's because I'm doing a database in memory NOR where the user can add, delete or edit the items in the table of DB.

    From what I gather mode "r+" can not be used to open a file because it is not supported by the library. In this case I am looking for a way where it can be done this type of operation so that I can create this database.

Children
No data