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
I have read the documentation at readthedocs and the issue is not addressed there.
I have tested that the issue is present in current master branch (aka latest git).
I have searched the issue tracker for a similar issue.
If there is a stack dump, I have decoded it.
I have filled out all fields below.
Platform
Hardware: ESP8266 (NodeMCU 4M)
Core Version: latest, 2.4.1
Development Env: Platformio
Operating System: Ubuntu
Settings in IDE
Module: Wemos D1 mini
Flash Mode: dio
Flash Size: 4MB
lwip Variant:
Reset Method:
Flash Frequency: 40Mhz
CPU Frequency: 80Mhz
Upload Using: SERIAL
Upload Speed: 921600
Problem Description
The documentation states that a filename needs to start with a slash but this is not quite obvious. Trying to open a file for writing whose filename has no leading slash is successful. I can even write to the file, close it and determine its size afterwards. It only does not show up in a directory listing.
Either opening a file whose filename does not start with a leading slash should fail in the first place or the leading slash should be implicitely added.
Just did a test and files created without a slash are present in directory lists.
SPIFFS does not have directories, and "openDir(x)" matches the string sent in. A "/" is just another character, not a directory separator.
So a file created as "bar.txt" will not be present in a openDir("/"); listing, but is present if you do openDir("");. If you open("bar.txt", "r"); it opens just fine, too.
Closing as working-as-SPIFFS-is-designed. For real directories, look at the LittleFS or SDFS PRs.
Basic Infos
Platform
Settings in IDE
Problem Description
The documentation states that a filename needs to start with a slash but this is not quite obvious. Trying to open a file for writing whose filename has no leading slash is successful. I can even write to the file, close it and determine its size afterwards. It only does not show up in a directory listing.
Either opening a file whose filename does not start with a leading slash should fail in the first place or the leading slash should be implicitely added.
Code Snippet
The text was updated successfully, but these errors were encountered: