Team Spartan Cookies & Milk Forums
File Save - Printable Version

+- Team Spartan Cookies & Milk Forums (https://teamscm.co.uk)
+-- Forum: Garry's Mod (/forumdisplay.php?fid=4)
+--- Forum: Starfall (/forumdisplay.php?fid=7)
+--- Thread: File Save (/showthread.php?tid=3047)



File Save - 4N0NYM - 30-06-2019 12:34 PM

Hey,

Is there a way to see what Files exist ?
Also where are they saved and what limits do we have ?


RE: File Save - Person8880 - 30-06-2019 02:26 PM

You can use files.list() to return a table containing the names of all files stored (on the server or on your own client instance, you can't see files for other players).

Where files are saved depends on where you've used the file/io libraries. On the server, files are saved to a player-unique folder on the server itself. On the client, files are saved in your data folder under data/starfallscriptdata/<STEAM ID>.

As for limits, I've added a few new functions to provide the limits:
  • files.getMaxNumFiles() - returns the maximum number of files you can store at a given time.
  • files.getMaxSize() - returns the maximum size a single file can be.
It's also worth noting that you can change these limits for files saved to your client using the convars:
  • sf_io_maxfilecount_cl - defaults to 20.
  • sf_io_maxfilesize_cl - defaults to 10240 bytes (10KiB).