libft
Loading...
Searching...
No Matches
Macros | Functions
ft_file.h File Reference

File utility functions for simplified and safe file operations. More...

+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define BUFFER_SIZE   1024
 Default buffer size for reading operations like get_next_line.
 
#define MAX_FD   1024
 Maximum number of file descriptors supported simultaneously.
 

Functions

int ft_open_file (const char *filename, int flags)
 Opens a file with the given flags.
 
ssize_t ft_read_file (int fd, void *buffer, size_t size)
 Reads a specified number of bytes from a file descriptor.
 
int ft_safe_close (int fd)
 Closes a file descriptor safely.
 
char * get_next_line (int fd)
 Reads a line from a file descriptor.
 

Detailed Description

File utility functions for simplified and safe file operations.

Author
Toonsa
Date
2025/04/05

This header declares helper functions for interacting with files. It includes wrappers around system calls like open, read, and close, providing consistent error handling and improved safety.

It also includes the get_next_line function for reading input line-by-line.