module Godot::SystemIO

Overview

Low-level CRT file I/O that operates safely on alien/engine threads without depending on Crystal's IOCP event loop or Thread/Fiber runtime state.

Defined in:

libgodot/system_io.cr

Constant Summary

SEEK_END = 2
SEEK_SET = 0

Class Method Summary

Class Method Detail

def self.delete_file(path : String) : Bool #

Deletes a file on disk


[View source]
def self.file_exists?(path : String) : Bool #

Returns true if the file exists on disk and can be opened for reading


[View source]
def self.file_size(path : String) : Int64 #

Returns the size of the file in bytes, or -1 if the file cannot be opened


[View source]
def self.read_file(path : String) : String #

Reads the entire content of a file from disk into a Crystal String


[View source]
def self.write_file(path : String, content : String) : Bool #

Writes the entire content string to a file on disk


[View source]