https://github.com/yvann-ba/get_next_line
Custom C function to read lines from a file descriptor. Efficient memory and file handling
https://github.com/yvann-ba/get_next_line
42cursus cprogramming dynamicmemory filedescriptor
Last synced: 12 months ago
JSON representation
Custom C function to read lines from a file descriptor. Efficient memory and file handling
- Host: GitHub
- URL: https://github.com/yvann-ba/get_next_line
- Owner: yvann-ba
- Created: 2024-06-15T14:56:21.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-17T16:34:57.000Z (about 2 years ago)
- Last Synced: 2025-02-13T19:52:41.120Z (over 1 year ago)
- Topics: 42cursus, cprogramming, dynamicmemory, filedescriptor
- Language: C
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Get_Next_Line
## 📜 Description
"Get_Next_Line" is a project I completed at 42 School. The goal is to create a function that reads a line from a file descriptor, allowing efficient file input handling. This function helps manage dynamic memory and works with various file descriptors simultaneously.
#### ⭐ My 42 score for this project:

#### 📄 Official 42 School Subject:
https://github.com/rphlr/42-Subjects/blob/main/common-core/get_next_line/en.subject.pdf
## 🌟 Features
- Read lines from a file descriptor
- Handle multiple file descriptors at once
- Efficient dynamic memory management
## ⚙️ Installation
To clone and compile this project, follow these steps:
```bash
git clone https://github.com/your-username/Get_Next_Line.git
cd Get_Next_Line
make
```
## 🚀 Usage
Include the function in your projects:
```c
#include "get_next_line.h"
```
Use the get_next_line function to read lines from a file:
```c
int fd = open("file.txt", O_RDONLY);
char *line;
while (get_next_line(fd, &line) > 0) {
printf("%s\n", line);
free(line);
}
close(fd);
```