☰
fileio
fuzion.sys.fileio
creates a directory using the specified path
parent directories in the path should exist otherwise, no creation will take place and an error will be the outcome
parent directories in the path should exist otherwise, no creation will take place and an error will be the outcome
deletes the file/dir found in the path
returns unit as outcome in case of successful deletion and error in case of failure
if the targeted dir has content, then the return value will be error and the deletion will not take place
returns unit as outcome in case of successful deletion and error in case of failure
if the targeted dir has content, then the return value will be error and the deletion will not take place
returns the current file-pointer offset as an outcome i64,
the offset is measured from the beginning of the file indicated by the file descriptor
returns the current offset in success and error in failure
the offset is measured from the beginning of the file indicated by the file descriptor
returns the current offset in success and error in failure
intrinsic that fills an array with some metadata of the file/dir provided by the path
returns TRUE in case the operation was successful and FALSE in case of failure
in case the path refers to a symbolic link it does not attempt to follow it and returns info about the link itself
in case an error is returned (the result of this feature is false), then the size field of
the meta_data array will contain the errno for the lstat call.
returns TRUE in case the operation was successful and FALSE in case of failure
in case the path refers to a symbolic link it does not attempt to follow it and returns info about the link itself
in case an error is returned (the result of this feature is false), then the size field of
the meta_data array will contain the errno for the lstat call.
memory map a file
res[0]: 0 on success, -1 on error
return: allocated memory (same as fuzion.sys.internal_array_init.alloc)
note: offset+size must not exceed file size.
note: returning allocated memory - instead of error code - simplifies handling in DFA.
res[0]: 0 on success, -1 on error
return: allocated memory (same as fuzion.sys.internal_array_init.alloc)
note: offset+size must not exceed file size.
note: returning allocated memory - instead of error code - simplifies handling in DFA.
moves file/dir from an old path to a the new path
can rename the file/dir as well by changing the name of the old file/dir to a new name in the new_path
returns a unit type as outcome in case of success and error in case of failure
can rename the file/dir as well by changing the name of the old file/dir to a new name in the new_path
returns a unit type as outcome in case of success and error in case of failure
close a memory mapped file
return: 0 on success, -1 on error
return: 0 on success, -1 on error
Opens an IO source using a Fuzion Any as path and an i8 flag to represent the opening method (Read: 0, Write: 1, Append: 2)
returns outcome i64 representing the file descriptor in success
returns an error in failure
returns outcome i64 representing the file descriptor in success
returns an error in failure
reads n bytes of a file opened as fd
in case the outcome is an array, it may be shorter than n. this means the end of file
has been reached.
in case the outcome is an array, it may be shorter than n. this means the end of file
has been reached.
seek offset in the stream represented by fd
returns an outcome i64 that represents the new offset
returns an error in case of failure
returns an outcome i64 that represents the new offset
returns an error in case of failure
intrinsic that fills an array with some metadata of the file/dir provided by the path
returns TRUE in case the operation was successful and FALSE in case of failure
in case the path refers to a symbolic link it resolves it and returns info about the actual file
in case an error is returned (the result of this feature is false), then the size field of
the meta_data array will contain the errno for the stat call.
returns TRUE in case the operation was successful and FALSE in case of failure
in case the path refers to a symbolic link it resolves it and returns info about the actual file
in case an error is returned (the result of this feature is false), then the size field of
the meta_data array will contain the errno for the stat call.
returns outcome unit in case of success and an error in case of failure