How to remove/delete data in a file through code?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By NDC227

I have a file with a list of scenes in the user’s save data. I want to remove the first item from the list of scenes. It seems like a simple thing to do, but it didn’t seem like there was anything in the documentation that would let me delete data from the file.

If this isn’t a functionality (which I find a little strange), what are some possible workarounds?

Thanks!

:bust_in_silhouette: Reply From: exuin

You will need to get the data from the file in a format that Godot can understand and then edit the data with some method. Then, you will need to save the new data into the same file. You can’t just delete data from a file without knowing the file format.