Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Log file with newest entry on top

Status
Not open for further replies.

GKatReliable

Programmer
Joined
Jul 2, 2002
Messages
45
Location
US
I want to create and maintain a log file for the user that shows the most recent entry on top. I am adding a date and time stamp to the log file entry. This is a pure text file.
I _WANT_ CR/LF's. I find that for whatever reason, adding TEXT to fopen does not add CR/LF with fputs. I tried FWRITE with `r`n and got Unexpected Escape Sequence.
I thought I could read the text file into a variable, then write out the new line and write out this variable after it, thereby putting the new line on top. This isn't working. For one thing, it is not overwriting the file with this technique. I've been searching the aspectscript website and this forum and good old Procomm script help for tidbits.

Regards,
Glenn Koproske
 
How are you opening the file now (i.e. what flags in addition to TEXT)? Is the rest of the string being added OK?

is a sample I have that shows how to insert into a text file if you want to just add the line instead of trying to overwrite an existing line.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top