Reimplemented File.read_lines using fgets