This is an old revision of the document!
Home > Developer > Lookafter Storage System API > GetDir
Script path: /storage/bin/api/get_dir.cgi
Description: Returns a list of items representing the directory listing of the given folder. Information for each item in the list can be optionally requested. Among the information available are: name, date, mtime, size, type, owner, company, lock status, description, checksum. Sorting of the list by selected fields and simple filtering of names is possible.
INPUT (via GET or POST)
Mandatory parameters are: sid, path
Optional parameters are: fields, filter, sortby, sorthow, ofmt
Session id of the login user. [mandatory]
Path to a folder. [mandatory]
Please refer to How to specify a path.
Path must point to an existing folder. E.g.:
= name,date,mtime,size,type,owner,company,lock,description, checksum
= name,date,size,type (this is default if no fields are provided)
The field names may be any order and the returned field values will follow that order. Separate the field names with commas but do not include any spaces. Fields obmitted will not be returned. Returned value for a field can be empty strings. If a field does not exist in the item's information record, an empty field is returned. WARNING: a misspelled field name will be quietly ignored, i.e. returned empty value!
= pattern(s) to match
List only items with name matching pattern using wild cards, *, ? and []
The match is done case-insensitive. Example:
*.txt - list all text files (.txt .TXT …)
a* - begining with letter “a” or “A”
file*.? - filenames ending with a single letter extension
* * - filenames with at least a space in them.
*[ho] - list filename ending with either “h” or “o”
Multiple patterns are specified with comma separating them, example, *.jpeg,*.jpg