Quick question, Is it possible to open a log file and read it from below?

I know you can do this;


But this read the file from the top. This takes quite some time when the file is too big in size.

Would it be possible to read the file from bottom to top?

Thank you


1 Answers

Deepak Bhavale On

You can implement the following Pseudocode for the solution of your problem:


while (fgets () != NULL)
   push line to stack
open output file
while (stack no empty)
   pop stack
   write popped line to file