Module file

Module file 

Source
Available on crate feature fs only.
Expand description

A handle to an opened file.

Structs§

NSTDFile
A handle to an opened file.

Constants§

NSTD_FILE_APPEND
Open a file in writing mode without overwriting saved data.
NSTD_FILE_CREATE
Creates the file upon opening if it does not already exist.
NSTD_FILE_READ
Open a file in read mode.
NSTD_FILE_TRUNC
Open a file in truncate mode, this will set the file’s length to 0 upon opening.
NSTD_FILE_WRITE
Open a file in write mode.

Functions§

nstd_fs_file_close
Closes a file handle.
nstd_fs_file_flush
Flushes a file stream.
nstd_fs_file_open
Opens file on the filesystem and returns a handle to it.
nstd_fs_file_read
Reads some data from an open file into a buffer.
nstd_fs_file_read_all
Continuously reads data from file into a buffer until EOF is reached.
nstd_fs_file_read_exact
Reads enough data from file to fill the entirety of buffer.
nstd_fs_file_read_to_string
Continuously reads UTF-8 data from file into a string buffer until EOF is reached.
nstd_fs_file_write
Writes some data to a file & returns how many bytes were written.
nstd_fs_file_write_all
Writes a whole buffer to a file.

Type Aliases§

NSTDFileResult
A result type yielding an NSTDFile on success.