Previous Thread
Next Thread
Print Thread
Email.logfile question #29303 22 Jul 19 04:45 PM
Joined: Sep 2002
Posts: 5,450
F
Frank Online Content OP
Member
OP Online Content
Member
F
Joined: Sep 2002
Posts: 5,450
Good day -

I am reading the log file to validate the email operation but it wasn't working, after some tinkering I noticed the log starts off with CR/LF (OD/OA see below). Is this SOP? Or a result of the ztxfer operation from pc -> linux? Do i need to just throw away the first line or code for an empty first line? TIA.

Block number 1 of 00002007221963792.LOG
000000: 0D 0A 32 32 2D 4A 75 6C 2D 31 39 20 31 37 3A 34 ..22-Jul-19 17:4
000010: 33 3A 32 36 20 49 44 3A 20 30 30 30 30 32 30 30 3:26 ID: 0000200

Re: Email.logfile question #29304 22 Jul 19 05:04 PM
Joined: Jun 2001
Posts: 11,645
J
Jack McGregor Online Content
Member
Online Content
Member
J
Joined: Jun 2001
Posts: 11,645
For whatever reason, I think that particular log file starts each entry with a CRLF, and ends it with just null. So you can just discard the first line, or perhaps any blank line. Also, make sure to test for eof() after processing the line, otherwise you may fail to process the last line.

Re: Email.logfile question #29305 22 Jul 19 06:30 PM
Joined: Sep 2002
Posts: 5,450
F
Frank Online Content OP
Member
OP Online Content
Member
F
Joined: Sep 2002
Posts: 5,450
Gotit. Thanks.

Re: Email.logfile question [Re: Frank] #31348 31 Jul 19 07:20 PM
Joined: Sep 2002
Posts: 5,450
F
Frank Online Content OP
Member
OP Online Content
Member
F
Joined: Sep 2002
Posts: 5,450
Just a public service announcement here...

Took me a while but I figured out why I wasn't reading the last line of the Log file correctly. (SID: Session ID info).

Whilst looping thru the input file, when reaching EOF()=1 i always close the file and move on..

In this case, trailing nulls in the previous line satisfied the EOF condition apparently and my program never loaded the last line. The fix was to load all the log variables before checking for EOF. Perhaps it's my fault for not using a better loop i.e. If NOT eof or REPEAT UNTIL, but thought i would pass this along... since it's sort of a non-standard situation.


Moderated by  Jack McGregor, Ty Griffin 

Powered by UBB.threads™ PHP Forum Software 7.7.3