Skip to content

inesmourato/get_next_line

Repository files navigation

get_next_line

About

This project is about programming a function that returns a line read from a file descriptor. If the function is inserted into a loop, it allows the content of a file to be returned, line by line, until the end of the file.

Mandatory

  • get_next_line() function should let you read the text file pointed to by the file descriptor, one line at a time.
  • The function should return the line that was read. If it's empty or gives an error returns NULL.
  • Function works when it's reading a file or a standard input.
  • Returned line should include the terminating \n character, except if it's the end of the file and the line does not end with \n.
  • The get_next_line.h header file should include at least the get_next_line() function.
  • All aditional functions should be included in get_next_line_utils.c file.
  • To define the buffer size for read(), add the option to the compiled file -D BUFFER_SIZE = n.

FORBIDDEN: Libft lseek() Global variables

Bonus

  • Use only one static variable.
  • Manage multiple file descriptors at the same time.
  • Bonus files should include a suffix _bonus.[c/h]:
    • get_next_line_bonus.c
    • get_next_line_bonus.h
    • get_next_line_utils_bonus.c

About

A function that returns a line read from a file descriptor.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages