You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating files of length greater than 31 causes extra characters to be appended to filename, which cannot then be deleted. (really it is 31, but the first / counts) shown below, is an example.
run the sketch, then run it again and you will see that the files 32 + 33, are not deleted.
proposal , adding length check to file.open()
File FS::open(const char* path, const char* mode) {
if (!_impl) {
return File();
}
OpenMode om;
AccessMode am;
if (!sflags(mode, om, am)) {
DEBUGV("FS::open: invalid mode `%s`\r\n", mode);
return File();
}
if (strlen(path) > 31) return File();
return File(_impl->open(path, om, am));
}
I do realise that 32 is the max length, I just wanted to demonstrate, but it appears 31 is really the practical max length. If you accidentally make this it should fail and not create an un-deletable file.
The text was updated successfully, but these errors were encountered:
Creating files of length greater than 31 causes extra characters to be appended to filename, which cannot then be deleted. (really it is 31, but the first / counts) shown below, is an example.
Here is a gist that demonstrates the problem.
https://gist.github.com/sticilface/20c9973da4ccbe993c97
Warning it deletes all files on the device.
run the sketch, then run it again and you will see that the files 32 + 33, are not deleted.
proposal , adding length check to file.open()
I do realise that 32 is the max length, I just wanted to demonstrate, but it appears 31 is really the practical max length. If you accidentally make this it should fail and not create an un-deletable file.
The text was updated successfully, but these errors were encountered: