Added File.isDirectory()

This commit is contained in:
Federico Fissore 2013-07-11 13:06:48 +02:00
parent 3ee30f326f
commit 40b2da7746
2 changed files with 12 additions and 1 deletions

View File

@ -150,6 +150,17 @@ const char *File::name() {
return filename.c_str();
}
boolean File::isDirectory() {
uint8_t res[1];
uint8_t lenght;
uint8_t cmd[] = {'i'};
if (mode != 255)
return 0;
bridge.transfer(cmd, 1, (uint8_t *)filename.c_str(), filename.length(), res, 1);
return res[0];
}
//boolean isDirectory(void)
//File openNextFile(uint8_t mode = O_RDONLY);
//void rewindDirectory(void)

View File

@ -45,7 +45,7 @@ public:
void close();
operator bool();
const char * name();
boolean isDirectory();
boolean iFileSystemirectory(void);
File openNextFile(uint8_t mode = FILE_READ);
void rewindDirectory(void);