study/42Seoul (2) 썸네일형 리스트형 [minishell] parsing - 1.preprocessing 1-1.tokenization 관련 PR : #33 token.c arr.c libft/lst*.c 토큰화 (tokenization)는 입력으로 받아온 문자열 형태의 데이터를 해석할 수 있는 token으로 만드는 과정이다. 아래의 구조체 struct s_token을 사용하여 토큰화를 진행하였다. token 구조체는 생성될 때 libft에 구현된 연결리스트 node의 content에 저장된다. 구조체 정보 typedef struct s_token { t_ttype type; char *str; } t_token; enum e_token_type ( t_ttype ) 정보 typedef enum e_token_type { T_WORD, // space 문자와 아래 문자들을 제외한 모든 문자 T_PIPE, /.. [C] stat / lstat / fstat 함수 파일 상태(정보) 가져오기 지정한 파일의 정보를 담고 있는 stat 구조체를 통해 정보를 얻을 수 있는 시스템 함수들 ls -al 명령어로 알 수 있는 내용들을 대부분 알 수 있다. #include int fstat(int fildes, struct stat *buf); int lstat(const char *restrict path, struct stat *restrict buf); int stat(const char *restrict path, struct stat *restrict buf); 구조체 stat - 함수의 인자로 들어가는 struct stat - st_dev - 파일을 포함하는 디바이스 번호 - st_mode - 파일의 모드 (접근권한) - 파일 종류 비트 마스크로 표시됨 - st_nl.. 이전 1 다음