Skip to content

19Jillian89/Get_next_line

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

get_next_line

Language Status 42 Bonus


πŸ” Project Overview

get_next_line is a function that reads a file line by line from a given file descriptor. Each call returns the next line, including the newline character (\n) if present. This project is part of the 42 Common Core curriculum, and is implemented using only the allowed functions: read, malloc, and free.


βœ… Features

  • πŸ“„ Returns one line per call (including \n)
  • πŸ“ Supports multiple file descriptors at once
  • βš™οΈ Customizable buffer size via BUFFER_SIZE
  • 🚫 No use of standard I/O functions (fgets, strtok, etc.)

πŸ” Bonus

The bonus part includes:

  • Reading from multiple file descriptors simultaneously without data leaks or interference.

  • Proper handling of edge cases (empty files, very long lines, etc.).

  • 🚧 I have completed the bonus part, but I'm currently working on fixing a small memory leak I discovered during testing.


πŸ“„ License

This project is for educational purposes and is part of the 42 Common Core curriculum.


If you found this project helpful or interesting, feel free to star ⭐️ or fork it!

About

Read a file line by line from a file descriptor using only read, malloc, and free.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages