#include <filesystem.h>
Public Member Functions | |
Directory () | |
char | open (const char *name) |
bool | next (char *name, unsigned int &size, unsigned char &attrib) |
Static Public Member Functions | |
static bool | exists (const char *name) |
Static Public Attributes | |
static const unsigned int | FILENAME_LEN = 13 |
IMPORTANT:
Name of files and directories is limited to old DOS 8.3 format. The name of the file must not exceed 8 chracter, and the extension must not exceed 3 chars. Also the name must not contain spaces.
The directory listing function will return the name of file truncated if necessary (example "My_long_file_name.txt" will be reported as "MY_LON~1.TXT")
To open a file created on a computer, that has a long file name, you must use the truncated name too.
miosix::Directory::Directory | ( | ) |
Constructor.
bool miosix::Directory::exists | ( | const char * | name | ) | [static] |
name | name and path of directory in unix notation (example: "/mydir" and not "C:\mydir") Note that name of files and directories is limited to old DOS 8.3 format. |
bool miosix::Directory::next | ( | char * | name, | |
unsigned int & | size, | |||
unsigned char & | attrib | |||
) |
Get next directory entry.
name | a string where the file name will be copied. The string size must be >=FILENAME_LEN | |
size | size of the entry | |
attrib | entry attributes (allow undrstanding if entry is a file or directory) |
char miosix::Directory::open | ( | const char * | name | ) |
Open a directory, to list its content
name | name and path of directory in unix notation (example: "/mydir" and not "C:\mydir") Note that name of files and directories is limited to old DOS 8.3 format. |
const unsigned int miosix::Directory::FILENAME_LEN = 13 [static] |
This is the maximum length of entry name reported by Directory::next(). Use it to create buffers to pass to Directory::next(). This dimension includes the null termination character.