Skip to content

savefile()

Maingron edited this page Apr 2, 2021 · 4 revisions

Save a file

Code

savefile(path, content, override, attr);

Variables

  • path = Path of the desired file [String]
  • content = Content of the file you want to save [String]
  • override = Override the file if it already exists? [Boolean]
  • attr = File attributes like file type [String]

Aknowledged Attributes (attr / Filetype)

  • t=txt
  • t=dir
  • t=cmd
  • t=png
  • t=jpg

Note: This system will change in future. Until then you could just ignore the type except for folders. These have to be t=dir.

Example

savefile("C:/Documents and Settings/HelloWorld.txt", "Hello World!", 1, "t=txt");
savefile("C:/Documents and Settings/aFolder/", 0, 0, "t=dir");

Explanation

savefile() allows you to save a file within IOfs.