26 lines
1.1 KiB
C
26 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_read.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: vvobis <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2024/11/18 12:49:30 by vvobis #+# #+# */
|
|
/* Updated: 2024/12/10 21:18:38 by vvobis ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "libft.h"
|
|
|
|
int ft_read(int fd, char *character, unsigned int size_to_read)
|
|
{
|
|
int bytes_read;
|
|
|
|
bytes_read = read(fd, character, size_to_read);
|
|
if (bytes_read == -1)
|
|
{
|
|
ft_fprintf(STDERR_FILENO, "Read failed\n");
|
|
}
|
|
return (bytes_read);
|
|
}
|