1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-22 21:23:07 +03:00

Make FILE_WRITE append in SD.h wrapper (#6106)

* Make FILE_WRITE append in SD.h wrapper

Fixes #6105

* Update host tests
This commit is contained in:
Earle F. Philhower, III 2019-05-16 17:12:09 -07:00 committed by GitHub
parent 25c95ac185
commit 968d6fcb0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -27,7 +27,7 @@
#undef FILE_READ
#define FILE_READ sdfat::O_READ
#undef FILE_WRITE
#define FILE_WRITE (sdfat::O_READ | sdfat::O_WRITE | sdfat::O_CREAT)
#define FILE_WRITE (sdfat::O_READ | sdfat::O_WRITE | sdfat::O_CREAT | sdfat::O_APPEND)
class SDClass {
public:

View File

@ -350,10 +350,10 @@ TEST_CASE("Multisplendored File::writes", "[fs]")
f.write((const uint8_t*)&bigone, 4);
f.close();
REQUIRE(readFileSD("/file.txt") == "aAbbcctheendxyz@@@@");
File g = SD.open("/file.txt", FILE_WRITE);
File g = SD.open("/file2.txt", FILE_WRITE);
g.write(0);
g.close();
g = SD.open("/file.txt", FILE_READ);
g = SD.open("/file2.txt", FILE_READ);
uint8_t u = 0x66;
g.read(&u, 1);
g.close();