Skip to content
Sign upLog in
← Back to Community

Losing file data in repl.it

Profile icon
GandalfRobloxHacker

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 please tell me how to stop losing data? Ty.

Voters
Profile icon
InfiPuter
Profile icon
OBBYKING839
Profile icon
JohnjiRomanji
Profile icon
FLreplit
Profile icon
GandalfRoblox
Comments
hotnewtop
Profile icon
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.

Profile icon
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.

Profile icon
SLMJ

@Coder100
then how do you save data? does Replit Database save if you aren't on the repl?

Profile icon
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

Profile icon
GandalfRoblox

@PattanAhmed

This is confusing as I want it to save through the program, not save manually.

Profile icon
PattanAhmed

@GandalfyDev
Hi,
I think this is a minor bug.
If you also think it as a bug then please report in the Bugs Section,
By Clicking here

Hope this helps
Please mark my answer if this helps

Profile icon
TheForArkLD

Good luck, you can wait for save.