Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: DM_FATFileSystem EthernetInterface HTTPClient mbed-rtos mbed-src
Fork of DMSupport by
Diff: FileSystems/QSPIFileSystem.cpp
- Revision:
- 14:c21497031b1f
- Parent:
- 9:a33326afd686
- Child:
- 19:2efb6f5f69a4
diff -r 2c60e28503f8 -r c21497031b1f FileSystems/QSPIFileSystem.cpp
--- a/FileSystems/QSPIFileSystem.cpp Fri Dec 19 12:10:19 2014 +0100
+++ b/FileSystems/QSPIFileSystem.cpp Fri Dec 19 16:41:25 2014 +0100
@@ -1402,16 +1402,18 @@
DirHandle *QSPIFileSystem::opendir(const char *name)
{
- FileHandle* fh = open(name, O_RDONLY);
- if (fh != NULL) {
- // Attempting to open a file as a dir
- delete fh;
- return NULL;
- }
-
-// printf("opendir: name '%s'\n", name);
- if (strlen(name) <= HEADER_DNAME_MAXLEN) {
- return QSPIDirHandle::openDir(name);
+ if (isformatted()) {
+ FileHandle* fh = open(name, O_RDONLY);
+ if (fh != NULL) {
+ // Attempting to open a file as a dir
+ delete fh;
+ return NULL;
+ }
+
+// printf("opendir: name '%s'\n", name);
+ if (strlen(name) <= HEADER_DNAME_MAXLEN) {
+ return QSPIDirHandle::openDir(name);
+ }
}
return NULL;
}
