Can File.AppendAllText be used with very large files without causing memory issues?
I need to write to a very large text file adding content to it as I interact with a very large set of records in C # 3.5. This file can be several GB in size. I thought I would use File.AppendAllText to write to the file after each write has been processed. This way I do not store the file in memory. However, will AppendAllText read the entire contents of the file into memory when called, or will it just add new content to the end?
source to share
From the documentation for File.AppendAllText, it looks like it doesn't read the file in memory.
Opens a file, appends the specified string to the file, and then closes the file. If the file does not exist, this method creates a file, writes the specified string to the file, then closes the file.
source to share