Avisaro Online Documentation - Wiki
Impressum Kontakt Sitemap

DIR

Description

The DIR command can be used to show all files of a folder of the SD card. If no argument is given, DIR prints the files of the root directory. If an argument is attached, it must be the path of the folder which files should be displayed. Nested folder names must be separated by slashes. If the argument is a single slash only, the root directory is displayed as there were no argument.

For every entry in the specified directory the output format is:

1. 14 characters file or directory name in 8.3 FAT format. Long file names are not supported. If a file name is shorter it is filled up with space characters (0x20).

2. In case of files, a decimal number that is the file size. In case of folders, the five characters.

3. every entry is terminated by a CR/LF sequence (0x0d, 0x0a).

Return value

ERR_OK (0) if directory was read without error.
ER_FS_xx (13...25) file system error if anything's gone wrong while accessing the disk. 

Example

DIR 

Shows the content of the root directory

DIR dir1/dir2 

Shows the content of dir2 which is a sub directory of dir1 which resides in the root directory

Remarks

DIR only makes sense on modules that have some kind of mass storage like SD-Cards or USB-sticks. The output of DIR is somewhat different from the DOS-equivalent.