Can someone please give me some sample code that would show how to truncate one file by 512K and then append 511K back to the original file from the last 511K of a another source file. In psuedocode here is what I am trying to do:
//Get handle to the file to truncate
FileInfo f = new FileInfo("c:\\FiletoTruncate.txt");
FileStream s = f.Open(FileMode.Truncate);
// Need help here, how do I truncate by 512K?????
// Get 511K of a new file an append to file above
FileInfo appendFile = new FileInfo("c:\\getLast511K.txt");
// Need help in getting the last 511K of this and appending it to the first file