This endpoint is intended for working with the ROMFS file system managed by the KasperskyOS kernel.
Information about methods of the endpoint is provided in the table below.
Methods of the fs.FS endpoint (kl.core.FS interface)
Method
Method purpose and parameters
Potential danger of the method
Open
Purpose
Opens a file.
Parameters
[in] name – name of the file.
[out] handle – value whose binary representation consists of multiple fields, including a handle field and a handle permissions mask field. The handle identifies the file.
[out] rc – return code.
Allows the kernel memory to be used up by creating a multitude of objects within it.
Close
Purpose
Closes a file.
Parameters
[in] handle – value whose binary representation consists of multiple fields, including a handle field and a handle permissions mask field. The handle identifies the file.
[out] rc – return code.
N/A
Read
Purpose
Reads data from a file.
Parameters
[in] handle – value whose binary representation consists of multiple fields, including a handle field and a handle permissions mask field. The handle identifies the file.
[in] sectorNumber – data block number. Enumeration starts with zero.
[out] read – size (in bytes) of the read data.
[out] data – sequence containing the read data.
[out] rc – return code.
N/A
GetSize
Purpose
Gets the size of a file.
Parameters
[in] handle – value whose binary representation consists of multiple fields, including a handle field and a handle permissions mask field. The handle identifies the file.
[out] size – file size (in bytes).
[out] rc – return code.
N/A
GetId
Purpose
Gets the unique ID of a file.
Parameters
[in] handle – value whose binary representation consists of multiple fields, including a handle field and a handle permissions mask field. The handle identifies the file.
[out] id – unique ID of the file.
[out] rc – return code.
N/A
Count
Purpose
Gets the number of files in the file system.
Parameters
[out] count – number of files in the file system.
[out] rc – return code.
N/A
GetInfo
Purpose
Gets the name and unique ID of a file based on the file index.
Parameters
[in] index – file index. Enumeration starts with zero.
[in] nameLenMax – buffer size (in bytes) for saving the file name.
[out] name – name of the file.
[out] id – unique ID of the file.
[out] rc – return code.
N/A
GetFsSize
Purpose
Gets the size of the file system.
Parameters
[out] fsSize – size (in bytes) of the file system.