UNIX #stat #lstat

· LINUX/Linux
Interface int lstat(const char *restric path, struct stat *restrict buf) int stat(const char *restrict path, struct stat *restrict buf) Function 파일의 이름을 사용해 파일의 상태정보를 가져옴 Parameter path: 문자열로 '경로'에 해당 buf: 사용자가 제공하는 버퍼, 해당 경로의 파일 정보 저장소 Return Success: 0 Fail: -1 ★ lstat, stat함수의 차이점 접근 하고자 하는 대상 파일이 심볼릭 링크일 경우 발생! lstat -> 링크에 대한 정보를 리턴 stat -> 심볼릭 링크가 가리키는 원래 파일의 정보를 리턴. 그럼 stat 구조체의 정보를 아라보자...
M_Falcon
'UNIX #stat #lstat' 태그의 글 목록