Use FileStream.SetLength():
Dim strFile As String = "C:\Path\To\File.txt"
Dim fi As New FileInfo(strFile)
Dim fs As New FileStream(strFile, FileMode.Open, FileAccess.Write)
fs.SetLength(fi.Length - n)
fs.Flush()
fs.Close()
Showing posts with label truncate. Show all posts
Showing posts with label truncate. Show all posts
Friday, June 1, 2007
Subscribe to:
Posts (Atom)