Ask coding questions

← Back to all posts
Changes won't save
DickCashman (1)

Super new to coding so not used to overwriting files and stuff yet. Basically I had this set up so if you enter a person's name it rewrites the date in their file for today's date.

I tried this multiple times a few weeks ago and repl.it would permanently save the changes, but at some point it stopped. Now if I re-run the script after inputting a name, it will correctly show today's date for that person but then if I refresh it will load the original date.

I haven't changed anything in the code with respect to how it overrwrites files since them .. I just don't understand why it would save changes and now won't, and I can't find a way to manually save other than going into that file and typing/deleting.

Comments
hotnewtop
SixBeeps (5332)

File persistence is a bit weird in Repl.it. If you run things from the editor, you might be able to run things just fine, whereas anywhere else it won't save. This is a known thing, and it's not a bug; it's just how things work.
If you want to store things consistently, you need to learn about online databases and how to use them in your code.

DickCashman (1)

@niorg2606 yeah, when I tried initially nothing would save unless I ran it from the editor, but then it stopped working even from that. Any suggestions? Basically just dumpijg the dates to Google Docs and pulling from there or something?

SixBeeps (5332)

@DickCashman Essentially. Maybe not Google Docs, but there are plenty of services that have this feature for this exact purpose. Here's a few of them:

Note that many of these may be paid, just set up free accounts and go with the free tier services.