CryEngine.FileSystem.File

The File class is used to easily access files on the disk or in .pak files. More...

Static Public Member Functions

static bool Exists (string path)
Checks if the file at the specified path exists on disk or in a .pak file. More...
static byte [] ReadAllBytes (string path)
Reads all the bytes from start to finish of the specified file on the disk or in a .pak file. Throws a FileNotFoundException if the file doesn't exist. More...
static void Close (CryPakFile handle)
Closes the filehandle handle . More...
static uint Read (CryPakFile handle, byte[] buffer, uint length)
Read raw data into buffer from a file on the disk or in a .pak file, without endian conversion. More...
static CryPakFile Open (string path, FileMode mode)
Open the file at the specified path. Use mode to specify how to open the file. More...
static uint GetSize (CryPakFile handle)
Get the file size of file belonging to handle . More...

Detailed Description

The File class is used to easily access files on the disk or in .pak files.

Member Function Documentation

◆ Close()

static void CryEngine.FileSystem.File.Close ( CryPakFile handle)
inline
static

Closes the filehandle handle .

Parameters
handleThe file handle.

◆ Exists()

static bool CryEngine.FileSystem.File.Exists ( string path)
inline
static

Checks if the file at the specified path exists on disk or in a .pak file.

Returns
true, if a file exists, false otherwise.
Parameters
pathPath to the file.

◆ GetSize()

static uint CryEngine.FileSystem.File.GetSize ( CryPakFile handle)
inline
static

Get the file size of file belonging to handle .

Returns
The file size.
Parameters
handleFilehandle of the file.

◆ Open()

static CryPakFile CryEngine.FileSystem.File.Open ( string path,
FileMode mode
)
inline
static

Open the file at the specified path. Use mode to specify how to open the file.

Returns
The handle to the file.
Parameters
pathPath to the specified file.
modeThe FileMode to use to open the file.

◆ Read()

static uint CryEngine.FileSystem.File.Read ( CryPakFile handle,
byte [] buffer,
uint length
)
inline
static

Read raw data into buffer from a file on the disk or in a .pak file, without endian conversion.

Returns
The amount of bytes read.
Parameters
handleHandle to the file.
bufferBuffer that contains the read data.
lengthLength of the data to be read.

◆ ReadAllBytes()

static byte [] CryEngine.FileSystem.File.ReadAllBytes ( string path)
inline
static

Reads all the bytes from start to finish of the specified file on the disk or in a .pak file. Throws a FileNotFoundException if the file doesn't exist.

Returns
All the bytes of the file in a byte array.
Parameters
pathPath to the file.