0

Hi all,

In my application i will be writing data to a text file periodically (assume every 5 min.)
after some time i want clear the old contents without halting the application and with out deleting the file.

thanks in advance
johny

5
Contributors
6
Replies
8
Views
8 Years
Discussion Span
Last Post by jephthah
0

> and with out deleting the file.
What's this supposed to mean?

Or more to the point, what's a "clean" text file with anything other than zero bytes in it supposed to look like?

0

Hi,
I will be writing data to text file continuously ( assume 4-5days)
eg: file name johny123.txt
and data will be keep on appending to the text file.
on 2nd day I want to delete ( clear ) the contents of 1st day.
using C code I am clear when to clear the file, but i am not clear how to clear the contents of text file partially.
so that memory of text file will be reduced.

Thanks in advance

> and with out deleting the file.
What's this supposed to mean?

Or more to the point, what's a "clean" text file with anything other than zero bytes in it supposed to look like?

0

hiya it just opens the file and if it fails to do so reports an error message.

thanks for the last bit of advice Aia

0

timestamp your logs by date (or week, month, etc.) then you can delete the old ones at your leisure.

you can keep the most current log name without a timestamp if you like, then before creating a new one the next day (or week, month, etc.) just rename it.

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.