I’m trying to log data in a file on SD, using a timer, for this I need to be able to APPEND data to an existing data file on the SD, however, it seems the append method is not available within Visual Basic…
So, right now I have following code, which re-creates the “data.txt” file every time.
Private Sub StorageTimer_Tick(timer As Gadgeteer.Timer) Handles StorageTimer.Tick
' Write to file
Storage.GetStorageDevice.WriteFile("\data.txt", EncodedTxt)
End Sub
Dim SDfile As System.IO.FileStream
SDfile = SDCard.Open(file,System.IO.FileMode.Append,System.IO.FileAccess.Write)
SDfile.Write(...data...)
SDfile.Close()