Skip to content
Sign upLog in
Profile icon

GandalfRoblox

Hacker
@GandalfRoblox
Repls
Community
GandalfRoblox
GandalfRoblox
shared a Post
2 years ago
5
Losing file data in repl.it
Please tell me a fix for this, my program is over 20K lines long and it would be too hard to change it all, I use .json to stroe data, would somebody
GandalfRoblox
GandalfRoblox
Afternoon, I found a way to fix this. You need a function that every 20 seconds opens all the files and reads them, after that it should close them. As long as this is running your data in json files should be saving properly.2 years ago
Coder100
Coder100
Hi! Don't use JSON to store data, it actually won't save if you aren't on the repl. This is a security thing. Once repl.it got DDOSed from this (iirc). Anyways, here are the permissions: Your repl can view any file anytime Your repl can write to any file anytime Your repl cannot save to any file if no owner/collaborator is present. Ask @turbio for more on the repl.it api.2 years ago
PattanAhmed
PattanAhmed
@GandalfyDev Hi, You can try by pressing Ctrl+S(A save command). This is the only way to forcibly save the data anywhere. If worked then Cool If didn't work, then you can report it as a bug here. The community of Repl.it may follow you there... **Hope this helps Please mark my answer if this helps**2 years ago
GandalfRoblox
GandalfRoblox
shared a Post
2 years ago
3
Basically if I use my program to insert data into my json files, the next day it is gone? Why is this?
GandalfRoblox
GandalfRoblox
Ahh, I see. Is there a module to fix this?2 years ago
NoelB33
NoelB33
On repl.it, if your program changes a file, it won’t persist for the next time you run it. You can use an external database such as mongoDB, however. There is a database inside your repl called repldb, but it’s only for explorers (beta testers) only right now.2 years ago