user3837: 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

user4143: 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());


3837: <p>Anyone know how to use the <a href="https://www.arduino.cc/en/Reference/FileSeek" rel="nofollow">seek() function</a> of Arduino <a href="https://www.arduino.cc/en/Reference/SD" rel="nofollow">SD Library</a> to position pointer at the end of a file?</p>

<p>If programming in Windows do something like:</p>

<pre><code>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);
    }
}
</code></pre>

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

<pre><code>file.seek(file.size());
</code></pre>
