using seek() in Arduino to go to the end of a variable-sized file Anyone know how to use the seek() function of Arduino SD Library to position pointer at the end of a file?

If programming in Windows do something like:

void fileInsert(char *file, void *data, size_t len) {

    FILE *filePtr;

    if ((filePtr = fopen(file, "rb+")) == NULL) {
        printf("Arquivo %s não pode ser aberto.", file);
        exit(EPERM);

    } else {

        fseek(filePtr, 0L, SEEK_END);
        fwrite(data, len, 1, filePtr);
        fclose(filePtr);
    }
}


But the Arduino does not have the SEEK_END
You can only seek to an absolute position from the start of the file.  Fortunately there is the size() method that can tell you where the end is, though.

file.seek(file.size());