Skip to main content
Version: 0.0.1

System Modules

RayQuiro includes built-in system namespaces for file work, environment variables, and process execution.

rayquiro.fs

Import style:

import rayquiro.fs as fs;

fs.exists(path)

Returns true if a file or directory exists.

fs.mkdir(path)

Creates a directory tree. Returns true on success.

fs.copy(source, target)

Copies a single file. Parent directories for the target are created automatically.

fs.copy_tree(source, target)

Copies a directory tree recursively.

fs.remove(path)

Removes a file or directory tree and returns the number of removed entries.

fs.read(path)

Reads a text file and returns its contents. Returns an empty string if reading fails.

fs.write(path, content)

Writes a text file. Parent directories are created automatically.

Returns true on success.

rayquiro.fs example

import rayquiro.fs as fs;

fs.mkdir("build/demo");
fs.write("build/demo/hello.txt", "RayQuiro");

if (fs.exists("build/demo/hello.txt")) {
print(fs.read("build/demo/hello.txt"));
}

rayquiro.env

Import style:

import rayquiro.env as env;

env.get(name)

Reads an environment variable and returns its value as a string. Returns an empty string if the variable does not exist.

env.set(name, value)

Sets an environment variable for the current process. Returns true on success.

env.path_add(path)

Adds a directory to the user PATH.

On Windows, this updates the user environment registry key. It is used by the RayQuiro installer flow.

rayquiro.env example

import rayquiro.env as env;

print(env.get("PATH"));
env.set("RAYQUIRO_MODE", "demo");

rayquiro.process

Import style:

import rayquiro.process as process;

process.run(command)

Runs a shell command through the host system.

Returns the process exit code.

process.exe_dir()

Returns the current RayQuiro project root as a string in the interpreter path.

This is especially useful for installers and self-contained release flows.

rayquiro.process example

from rayquiro.process import run, exe_dir;

print("project root:", exe_dir());
run("cmd /c echo RayQuiro");

Real Installer Example

The bundled RayQuiro installer combines all three modules:

  • fs copies files
  • env.path_add adds C:/rayquiro/bin
  • process.exe_dir() locates the release root

Example:

import rayquiro.fs as fs;
from rayquiro.env import path_add;
from rayquiro.process import exe_dir;

var source = exe_dir() + "/rqio.exe";
var target = "C:/rayquiro/bin/rqio.exe";

fs.mkdir("C:/rayquiro/bin");
fs.copy(source, target);
path_add("C:/rayquiro/bin");

Notes

  • Paths are normal strings.
  • The APIs are intentionally small and pragmatic.
  • process.run(...) executes a shell command exactly as written, so validate inputs carefully when building automation tools.