Skip to content

This projects is about creating a function that, allows to read a line ending with a newline character "\n" from a file descriptor.

Notifications You must be signed in to change notification settings

HYYPNNOSS/Get-Next-Line

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

💡 About the project

The aim of this project is to make you code a function that returns a line, read from a file descriptor.

This project focuses on a fundamental function for programmers: reading text files line by line.

This approach is memory-efficient for handling large files, as it processes data one line at a time. By mastering this technique, you'll gain a solid foundation for various programming tasks that rely on file handling

🛠️ Usage

Requirements

The function is written in C language and thus needs the gcc compiler and some standard C libraries to run.

Instructions

1. Using it in your code

To use the function in your code, simply include its header:

#include "get_next_line.h"

and, when compiling your code, add the source files and the required flag:

get_next_line.c get_next_line_utils.c -D BUFFER_SIZE=<size>

📋 Testing

You only have to edit the get_next_line.c file and uncomment the main function and headers inside it. You can edit test.txt files to put another text if you wish to test othe cases. Then simply run this command (change "xx" with desired buffer size) :

gcc -Wall -Werror -Wextra -D BUFFER_SIZE=xx get_next_line.c get_next_line_utils.c && ./a.out

Or you can also use this third party tester to fully test the project

About

This projects is about creating a function that, allows to read a line ending with a newline character "\n" from a file descriptor.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages