Skip to main content

Commands: StartsWithAsync

Syntax

#Commands: StartsWithAsync

StartsWithAsync can be used to retrieve multiple file headers for the specified prefix name.

Task<FileHeader[]> StartsWithAsync(string prefix, string matches, int start, int pageSize);
Parameters
prefixstringThe prefix that the returned files need to match
matchesstringPipe ('|') separated values for which file name (after 'prefix') should be matched ('?' any single character; '*' any characters)
startintThe number of files that should be skipped
pageSizeintThe maximum number of the file headers that will be returned

Return Value
Task<FileHeader[]>A task that represents the asynchronous operation. The task result is the array of FileHeaders.

Example I

The below code will return 128 results at most for files which names start with /images.

FileHeader[] images = await store
.AsyncFilesCommands
.StartsWithAsync("/images", null, 0, 128);

Example II

In contrast to the previous example, here only the images which names end with .jpg will be returned.

FileHeader[] jpgs = await store
.AsyncFilesCommands
.StartsWithAsync("/images", "*.jpg", 0, 128);