Skip to content

Commit 968d6fc

Browse files
Make FILE_WRITE append in SD.h wrapper (#6106)
* Make FILE_WRITE append in SD.h wrapper Fixes #6105 * Update host tests
1 parent 25c95ac commit 968d6fc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Diff for: libraries/SD/src/SD.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#undef FILE_READ
2828
#define FILE_READ sdfat::O_READ
2929
#undef FILE_WRITE
30-
#define FILE_WRITE (sdfat::O_READ | sdfat::O_WRITE | sdfat::O_CREAT)
30+
#define FILE_WRITE (sdfat::O_READ | sdfat::O_WRITE | sdfat::O_CREAT | sdfat::O_APPEND)
3131

3232
class SDClass {
3333
public:

Diff for: tests/host/fs/test_fs.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -350,10 +350,10 @@ TEST_CASE("Multisplendored File::writes", "[fs]")
350350
f.write((const uint8_t*)&bigone, 4);
351351
f.close();
352352
REQUIRE(readFileSD("/file.txt") == "aAbbcctheendxyz@@@@");
353-
File g = SD.open("/file.txt", FILE_WRITE);
353+
File g = SD.open("/file2.txt", FILE_WRITE);
354354
g.write(0);
355355
g.close();
356-
g = SD.open("/file.txt", FILE_READ);
356+
g = SD.open("/file2.txt", FILE_READ);
357357
uint8_t u = 0x66;
358358
g.read(&u, 1);
359359
g.close();

0 commit comments

Comments
 (0)