File System
std:fs
are functions that provide file system operations in Extron.
Functions
read_file ( path: string )
Reads the contents of a file and returns it as a string.
import "std:fs";
let content = read_file("file.txt");
print(content);
Console;
Hello, World!;
write_file ( path: string, content: string )
Writes the given content to a file.
import "std:fs";
write_file("file.txt", "Hello, World!");
file_exists ( path: string )
Checks if a file exists.
import "std:fs";
let exists = file_exists("file.txt");
print(exists);
Console;
true;