I think you can use fopen to get the handle, then use filesize to get the size and fseek to go to filesize-50. Then it's just fread of 50 characters to get the last 50. I imagine this ha been done before if you look at the manual under fseek.
Here is the solution in the fseek manual entry. Just change the -1 on the fseek line to -50.
As simple as this
I think you can use fopen to get the handle, then use filesize to get the size and fseek to go to filesize-50. Then it's just fread of 50 characters to get the last 50. I imagine this ha been done before if you look at the manual under fseek.
Here is the solution in the fseek manual entry. Just change the -1 on the fseek line to -50.
I guess you could also be using "tail" if you are on linux.
There are some sollutions in comments for function
fseek
.