Does anyone know how to limit the size of a file? (Resolved)
I need to limit the size og my proggies log file based on some
sort of number i.e 2 meg or some such... i am going to use a
drop down of sizes to choose from...
does anyone have any ideas?
with respect
bindu
P.S
See Here for How to Setup Logging Easily
Download this Fantastic Tool
>>> mztools
That tool is utterly the best thing that has ever been invented for VB...
:wave:
Yep i tollay forgot about FileLen Thanks a lot
Yeh That will do the job Thanks.. you will like this...
I am sure you will like this...
Quote:
Originally posted by StevenHickerson
Well off the top of my head I'd say just run a check on the file when you go to write to it.
Example...
VB Code:
If FileLen(LogFile) > 2048 then
'Logfile = path of your logfile and 2048
'I think is approx 2 megs in bytes lol can't remember offhand.
'Do whatever you want to do with the file to keep it from getting bigger..
'One thing would be to skip the first line of the file and read in the rest and then save it
'plus the new line back into the file..
'Depends on how you save as to what line you would skip
End If