miosix::Directory Class Reference
[Filesystem]

#include <filesystem.h>

List of all members.

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


Detailed Description

This class represent a directory. It has methods for listing files inside them. All methods can be called only if the filesystem is mounted.

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.


Constructor & Destructor Documentation

miosix::Directory::Directory (  ) 

Constructor.


Member Function Documentation

bool miosix::Directory::exists ( const char *  name  )  [static]

Parameters:
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.
Returns:
true if directory exists.

bool miosix::Directory::next ( char *  name,
unsigned int &  size,
unsigned char &  attrib 
)

Get next directory entry.

Parameters:
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)
Returns:
true while there are entries in the directory Note that if the return value is false, name size and attrib are not valid

char miosix::Directory::open ( const char *  name  ) 

Open a directory, to list its content

Parameters:
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.
Returns:
0 on success. Error codes are:


Member Data Documentation

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.


The documentation for this class was generated from the following files:

Generated on Mon Aug 30 00:05:00 2010 for Miosix by  doxygen 1.5.9