-
Notifications
You must be signed in to change notification settings - Fork 7.6k
fs file open for read|write #6227
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
Hello, can you please retest this on v2.0.3-rc1? |
I get the same message with version 2.0.3-rc1. #define FILE_READ "r" |
Thanks for testing @xinkiknix, are you able to propose PR? |
PR? |
@xinkiknix When calling FS.open, you can pass any of the file open modes which you can normally pass to C |
Thanks, for the update, but then why are there these definitions? #define FILE_READ "r" |
Those defines are legacies from Arduino's SD.h. ESP32 has POSIX compatibility under the covers, so provides emulated Arduino behaviors. |
I don't think it's safe to use |
try "a+" and "w+". i don't know about "rw", only "a+", "r+", "w+" and I suppose "r+" shouldn't create file, while "w+" and "a+" should |
Ah yeah |
Hi everyone, Seems like this issue is resolved. I close it for now. In case the same issue occurs, or you would need to discuss it further, please reopen it and we will revisit it. Thanks |
Board
ESP32
Device Description
ESP32 NodeMCU
Hardware Configuration
na
Version
v2.0.2
IDE Name
Arduino IDE
Operating System
Windows 10
Flash frequency
40
PSRAM enabled
yes
Upload speed
115200
Description
I can not position in a file (Seek) and overwrite a portion. There is no option in FS for RW (O_RDWR or FREAD|FWRITE)
I can only open for FILE_READ, FILE_WRITE, FILE_APPEND.
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: