|
-
Aug 17th, 2007, 08:02 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] Max File Size
Hi All,
I would like to create a log file for one of my applications so that I can limit the size of the file.
At the moment I am going to read in the entire file. If the file is larger then the size limit specified. I was add the new line to an array in memory and the write the file to the array in reverse order up to the size limit specified.
But the performance of my application will suffer if I make a lot of writes to this file.
Does anyone have a better way of handling this type of file writing?
-
Aug 17th, 2007, 08:39 PM
#2
Re: Max File Size
I would suggest that when you want to write to the log file you ignore the file size and just use AppendAllText to write. When your app is shutting down, then you could check the file size and trim it if required. That way you aren't reading and trimming over and over while your app is running.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|