Need to rename a file

Hello, im am trying to create a program that searches for a pre exsiting file and if it exsits it will delete it and if it does not exist then it continues on and creates a new file with the same name. This file will have an audio recored message stored in it. I want to be able to press a button, record a message and store it with a specific name on an SD card. Can anyone help

Start with making a button work:

Then a voice recording (where you can use your button):

Then search and replace files (under "File Management"):

What hardware are you using. Have you constructed some sort of a schematic for this. Have you decided what parts you need, ...etc.

What you describe does not involve renaming a file

Is this because you can't overwrite the existing file? If you try, does the code just append to then of the existing file?

Off the top of my head, it's likely that you are opening the file with the mode FILE_WRITE, which I think also includes the append flag. I seem to recall the solution was to specify the individual flags excluding the append flag.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.