Possible to write multi-sector sized files to SD card?

I found an apparent limit of one-sector for writing a file to the SD card. At least as far as there is an example of writing in the SDMMC example in seed examples. I can set len to be any number up to 511 for a successful creation and write of a file of size of up to 511 bytes but when I make it 512 or higher, the write fails. Even if I change all the buffers to be 1024 bytes. And, of course, 512 is about the size of one sector on an SD card.

Perhaps someone with more knowledge of fatfs than I can tell me if this is a limit with the fatfs library in daisy or if there is a different setup needed than what is in SDMMC.cpp to write a file that is more than one sector large. I know the WavWriter example of course does but it does it in a streaming sort of way that probably doesn’t write anything bigger than 511 bytes at time. I don’t want to have to “stream” a measly text file.

Thanks

Ok I’m not sure if this is the “correct” way or if there is some function in fatfs I should be using instead but this will write a file of any len if you replace line 67 in SDMMC.cpp (starting with f_write) with:

size_t chunk_size = 511;
size_t remaining = len;
size_t offset = 0;
while (remaining > 0) {
    size_t to_write = (remaining > chunk_size) ? chunk_size : remaining;
    f_write(&SDFile, outbuff + offset, to_write, &byteswritten);
    offset += to_write;
    remaining -= to_write;
}

That will write it in chunks not bigger than 511 bytes.