Skip to content

Commit

Permalink
Add usedSize() and totalSize()
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulStoffregen committed Nov 13, 2020
1 parent c5292ae commit 9b52e7d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/SD.h
Expand Up @@ -138,14 +138,21 @@ class SDClass : public FS
return sdfs.mkdir(filepath);
}
bool rename(const char *oldfilepath, const char *newfilepath) {
return sdfs.remame(oldfilepath, newfilepath);
return sdfs.rename(oldfilepath, newfilepath);
}
bool remove(const char *filepath) {
return sdfs.remove(filepath);
}
bool rmdir(const char *filepath) {
return sdfs.rmdir(filepath);
}
uint64_t usedSize() {
return (uint64_t)(sdfs.clusterCount() - sdfs.freeClusterCount())
* (uint64_t)sdfs.bytesPerCluster();
}
uint64_t totalSize() {
return (uint64_t)sdfs.clusterCount() * (uint64_t)sdfs.bytesPerCluster();
}
public: // allow access, so users can mix SD & SdFat APIs
SDFAT_BASE sdfs;
};
Expand Down

0 comments on commit 9b52e7d

Please sign in to comment.