hi
did you find you how limit the size? could you help me regarding that?
And regarding deleting lines from the top, you will have to rewrite the entire file to a new one , add the new lines to that file.
If necessary rename the new file to the old one after deleting the old file