8000 GitHub - willianlim/get_next_line: ⏩ Function similar to the fgets from C. This function allows a file to be read line after line.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

willianlim/get_next_line

Repository files navigation

Function should let you read the text file pointed to by the file descriptor, one line at a time.

📥 Installation

git clone https://github.com/willianlim/get_next_line

✍ Usage

import foobar

# returns 'words'
foobar.pluralize('word')

# returns 'geese'
foobar.pluralize('goose')

# returns 'phenomenon'
foobar.singularize('phenomena')
/*
	Example of main file for teste
*/

#include <stdio.h>
#include <fcntl.h>
#include "get_next_line.h"

int main(void)
{
	int		fd;
	char	*line;

	fd = open("file_teste.txt", O_RDONLY);
	while(1)
	{
		line = get_next_line(fd);
		if (!line)
			break ;
		printf("%s", line);
		free(line);
	}
	return (0);
}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

📝 License

About

⏩ Function similar to the fgets from C. This function allows a file to be read line after line.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0