File Open - 0x01

Description

Open a file for reading and/or writing.

Request

Offset Size Frame Field Description
5 8-bit

File System Command

File Open - 0x01
6 16-bit

Path ID

See Get Path ID - 0x1C for a description.

8 8-bit

Options

Bitfield with the following values:

  • 0x01 CREATE: Create if file doesn't exist.

  • 0x02 EXCLUSIVE: Error out if file exists.

  • 0x04 READ: Open file for reading.

  • 0x08 WRITE: Open file for writing.

  • 0x10 TRUNCATE: Truncate file to 0 bytes.

  • 0x20 APPEND: Append to end of file.

  • 0x40 UNUSED: Unused, set to 0.

  • 0x80 SECURE: Create a secure write-only file.

9-n variable File Name

Pathname relative to Path ID.

 

Success Response

Offset Size Frame Field Description
5 8-bit

File System Command

File open - 0x01
6 8-bit

Status

Success - 0x00
7 16-bit

File Handle

Value used to reference file in later requests. Expires and becomes invalid if not referenced for over 2 minutes.
9 32-bit

File Size

File's size or 0xFFFFFFFF if unknown.