Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Method

GetItems

abstract virtual func GetItems(maxItems: int) -> Result<Sequence<StorageItem>, StorageLookupError>

Declaring type: Directory
Module: System.Storage
Assembly: System.Runtime.dll
Source file: StorageItems.rvn

Defined by Directory.GetItems · Required implementation (no default).

Interface implementation: Required implementation (no default).

Retrieves a bounded snapshot of direct child item interfaces.

Parameters

Name Type Description
maxItems Int32 Maximum number of items to return. Negative values return InvalidRange; exceeding provider bounds or the requested count returns LimitExceeded.

Return value

Result<Sequence<StorageItem>, StorageLookupError>

A Sequence of File and Directory values exposed as StorageItem, or StorageLookupError. No partial successful listing is returned.

Remarks

Synchronous; callers own no enumeration handle. FileSystem accepts 0 through 1024 items, bounds native child-name bytes to 64 KiB, and sorts names ordinally. Zero succeeds only for an empty directory. Listing is not atomic with child lookup; concurrent changes can fail the whole operation. Unsupported child kinds or names can fail the listing. Provider ordering and snapshot consistency can differ; no live sequence or stable identity is promised.