Apps     Components     Interfaces     All Files     Source Tree     source: tos.lib.FS.FileDir.nc

Interface: FileDir

List files in filing system

Components providing this interface:
tos.lib.FS.Dir
tos.lib.FS.Matchbox

Components requiring this interface:
tos.lib.FS.Remote

Commands

Events

Commands - Details

start

result_t start(void)

List names of all files in filing system. Filing system is busy until FAIL is returned from readNext or no more files remain.
Returns: SUCCESS: files can be read with readNext FAIL: filesystem is busy

readNext

result_t readNext(void)

Return next file in filing system
Returns: SUCCESS: attempt proceeds, nextFile will be signaled FAIL: no file list operation is in progress.

freeBytes

uint32_t freeBytes(void)

Returns: Number of bytes available in filing system.

Events - Details

nextFile

result_t nextFile(const char *filename, fileresult_t result)

Report next file name.

Parameters:

filename - One of the files in the filing system if result is FS_OK, NULL otherwise. The storage for filename only remains valid until the end of the event.

result - FS_OK filename is the next file. FS_NO_MORE_FILES No more files. FS_ERROR_xxx Filing system data is corrupt.

Returns: SUCCESS: continue reporting file names
FAIL: abort the file lising operation
If the result is an error or no more files, the file listing operation terminates.