improve archive_fgets api