-
Notifications
You must be signed in to change notification settings - Fork 7.6k
SD open(): behavior on missing path on write #5019
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions. |
Hello @me-no-dev this is marked as closed, but it is still in the To-Do (Seeking Contributors) list. Do you want someone working on this or this is actually the expected behavior ? |
@Villaquiranm seems that Stale BOT closed it. Surely needs work though :) |
[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future. |
1 similar comment
[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future. |
Great @me-no-dev thanks a lot for your response, I would like to start working on this (maybe I'll need some mentoring). For the moment I will try to reproduce, understand the code on the library, and compare it to the Just to check |
Hello @Villaquiranm and @fabianoriccardi, "Opens a file on the SD card. If the file is opened for writing, it will be created if it doesn't already exist (but the directory containing it must already exist)." It will create a file if not exist but the directory must already exist. |
@fabianoriccardi PTAL, Is the answer above sufficient? |
* SD.open() new feature for creating all folders in path This PR adds to the SD.open() function option to create all folders to the file. SD.open(const char* path, const char* mode, const bool create) Default value of create is false. When true folders are created. From issue #5019 * Update vfs_api.cpp memccpy -> memcpy * File f = open() edit added false for create
* SD.open() new feature for creating all folders in path This PR adds to the SD.open() function option to create all folders to the file. SD.open(const char* path, const char* mode, const bool create) Default value of create is false. When true folders are created. From issue #5019 * Update vfs_api.cpp memccpy -> memcpy * SD_MMC deinit fix Wrong deinit function was called.
Hi,
I had noted that
SD.open(/path/to/file/, "w")
does not create the path to file if missing. I think this behavior is intuitive if you know the underlying implementation fopen, which does not create missing folders. However, I was used to ESP8266 Arduino core (SDFS and SPIFFS), and the common behavior creates any missing path.Is this an intended behavior or a bug? Is there a parameter to force automatic creation of missing path?
IMHO, create missing path is very intuitive and more suitable for Arduino users.
The text was updated successfully, but these errors were encountered: