Skip to content
This repository was archived by the owner on Jun 26, 2019. It is now read-only.
frenzylabs edited this page Dec 14, 2010 · 1 revision

CoreJS System library is to provide some basic system level functions commonly used for server/desktop side.

Global system methods:

// Print to the console/stdout
print("Hello World");

System object methods:

// Print to console/stdout (aliased global)
System.print("Hello World");

// Print to console/stdout with new line
System.println("Hello World");

// Read the contents of a file, return a string.
var fileContents = System.readfile("/path/to/file");

// Get current working directory
var cwd = System.cwd();

// Chmod (GNU) command
System.chmod("/path/to/item", 0777);

// Move/rename a file/directory
System.mv("/from/path", "/to/path");

// Test if an item exists
System.exists("/path/to/something");

// Test if something can be written to:
System.isWritable("/path/to/item");

// Test if something can be read:
System.isReadable("/path/to/item");

// Exit the process, terminate.
System.exit(0);

Clone this wiki locally