How to power-up SD Card manually with digital pins to control its power consump.

will the sdfat continue appending new data to that file even if the file is already 1MB or bigger?

The maximum file size for FAT16/FAT32 files is 4 GB so 1MB is no problem.

If you close the file and power off the card, you will need to reopen the file with an option to position the file at the end.

Here is an example:

  if (!file.open("FILENAME.TXT", O_WRITE | O_CREAT | O_APPEND)) {
    // handle open error here
 }

You can also position the file to the end with seekEnd() like this.

  file.seekEnd();

The SD.h wrapper always positions files opened for write at the end. SdFat follows Linux and the open group standard of opening files at the beginning unless an option is specified to position the file.

If possible avoid opening and closing large files, the overhead can become large. You can use the SdFat sync() call to insure no data will be lost if the program terminates before closing the file.

  // write data here
  file.print(firstItem);
  // ...
  // force cached data to file
  if (!file.sync()) {
    // handle write error here
  }