๐ Get_next_line
@42seoul : (2020.07.01 ~ 2020.07.15)
๐ About
- ์ด ํ๋ก์ ํธ๋ fd์ ์ ์ฅ๋ ํ์ผ ๋ด์ฉ์ "\n" ๊ฐํ ๋จ์ ์ค๋ก ๋ฐํํ๋ ํจ์๋ฅผ ๊ตฌํํฉ๋๋ค.(The aim of this project is to make you code a function that returns a line
ending with a newline, read from a file descriptor.)
Type | Function | Description |
---|---|---|
file read |
get_next_line(int fd, char **line) | Write a function which returns a line read from a file descriptor, without the newline. |
๐ Review
- fd ๊ด๋ฆฌ์ static variable์ ํ์ฉํ๋ ๋ฐฉ๋ฒ์ ๋ฐฐ์ธ ์ ์์์ต๋๋ค.
- python์ read.csv() ํจ์๋ฅผ ๋ง๋ ๋ค๊ณ ํ์ ๋ ๋จ์ํ "\n" ๊ฐํ ๋จ์๋ก ํ์ ๋๋๊ณ sep(๊ตฌ๋ถ์) ๋จ์๋ก ์ด์ ๋๋ ์ ์๋๋ฐ C์์๋ ์ด์ Libft ํ๋ก์ ํธ์ Get_next_line ํ๋ก์ ํธ ํจ์๋ฅผ ํฉ์น๋ฉด ์ฝ๊ฒ read.csv() ๊ฐ์ ํจ์๋ฅผ ๋ง๋ค ์ ์๋ค.
๐ Run
- Read File
- Iris.csv(๋ถ๊ฝ ๋ฐ์ดํฐ)๋ฅผ "\n"๊ฐํ ๋จ์๋ก ์ฝ๊ธฐ -> get_next_line()
- ๊ฐํ ๋จ์๋ก ์ฝ์ ๋ฐ์ดํฐ user_output ์ผ๋ก ์ ์ฅ
- diff user_output ./Iris.csv

๋๊ธ0