Directory Open - 0x11

Description

Used with Directory Read to list files and directories in a given directory. To get a listing of entries in a directory:

  1. Send a Directory Open Request.

  2. Parse multiple entries from the Response.

  3. If the last entry has the ENTRY_IS_LAST flag set, the listing is complete and the Directory Handle was automatically released.

  4. If the listing is not complete, do one of the following:

Request

Offset Size Frame Field Description
5 8-bit

File System Command

Directory Open 0x10
6 16-bit

Path ID

See command Get Path ID - 0x1C for description.

8-n variable

Directory Name

Pathname relative to Path ID, or empty to get a file listing for the Path ID.

Success Response

A Directory Open Request sends a response identical to a Directory Read Request. An empty directory returns a single entry with only the ENTRY_IS_LAST flag set, and a 0-byte Entry Name. A response ending with an ENTRY_IS_LAST flag automatically closes the Directory Handle.

Offset Size Frame Field Description
5 8-bit

File System Command

Directory Read - 0x13 or Directory Open - 0x11, depending on request.
6 16-bit

Status

Success - 0x00

7 16-bit

Directory Handle

Value returned in initial Directory Open Response.
9 32-bit

File Size/Entry Flags

File's size in lower 24 bits, combined with the following flags:

  • 0x80000000 (ENTRY_IS_DIR): Entry is a directory.

  • 0x40000000 (ENTRY_IS_SECURE): File is secure (write-only).

  • 0x01000000 (ENTRY_IS_LAST): This is the last entry.

  • Other flags in the top 8 bits (0x3E) are currently reserved and set to zero.

13-n variable Entry Name

 

File or directory name.

If there is enough room in the frame, there may be additional entries after the first.

n+1 8-bit

Null Terminator

0x00 byte to separate entries
n+2 32-bit

File Size and Flags

Refer to description above.

n+6 variable Entry Name

 

Refer to description above.

Process the entries in a Directory Open Response or Directory Read Response as follows: