Class FileLists
Helper class to generate RRF-style file lists
Inherited Members
Namespace: DuetAPI.Utility
Assembly: DuetAPI.dll
Syntax
public static class FileLists
Methods
GetFileList(string, string, int, int)
Get a /rr_filelist or M20 files response
Declaration
public static string GetFileList(string directory, string physicalDirectory, int startAt = -1, int maxSize = -1)
Parameters
Type | Name | Description |
---|---|---|
string | directory | RRF path to the directory |
string | physicalDirectory | Physical directory |
int | startAt | First file index to return. Set startAt to -1 to omit error handling and the JSON object container |
int | maxSize | Maximum size of the file list in bytes or -1 if unset |
Returns
Type | Description |
---|---|
string | JSON list |
GetFiles(string, string, int, bool, int)
Get a /rr_files or M20 files response
Declaration
public static string GetFiles(string directory, string physicalDirectory, int startAt = 0, bool flagDirs = false, int maxSize = -1)
Parameters
Type | Name | Description |
---|---|---|
string | directory | RRF path to the directory |
string | physicalDirectory | Physical directory |
int | startAt | First item to send |
bool | flagDirs | Prefix directories with an asterisk |
int | maxSize | Maximum size of the file list in bytes or -1 if unset |
Returns
Type | Description |
---|---|
string | JSON file list |