* ls-basic에 l옵션과 a옵션을 추가한다.
a = 히든 파일까지 모두 출력.
l = 파일의 모든 정보 출력.
stat() - 파일에 대한 정보를 얻는다.
getpwuid() - 유저에 대한 정보를 얻는다.
getgrgid() - 그룹에 대한 정보를 얻는다.
localtime() - struct time_t 를 struct tm 으로 변환한다.
getcwd() - 현재 디렉토리 경로를 출력한다.
getopt() - 명령어 옵션을 처리한다.
header : <pwd.h>
•Data type : struct passwd
•members :
–char*pw_name// username
–char *pw_passwd// user password
–uid_t pw_uid// user ID
–gid_tpw_gid// group ID
–char*pw_gecos// user information
–char *pw_dir// home directory
–char *pw_shell// shell program
header : <grp.h>
•Data type : struct group
•members :
–char *gr_name// group name
–char *gr_passwd// group password
–gid_t gr_gid// group ID
–char **gr_mem// group members
header : <sys/stat.h>
•Data type : struct stat
•members :
–ino_t st_ino// inode number
–mode_t st_mode// protection
–nlink_t st_nlink// number of hard links
–uid_t st_uid// user ID of owner
–gid_t st_gid// group ID of owner
–off_tst_size// total size, in bytes
–time_tst_atime// time of last access
–time_tst_mtime// time of last modification
–time_tst_ctime// time of last status change
header : <time.h>
•Data type : struct tm
•members :
–int tm_sec// Seconds. [0-60] (1 leap second)
–int tm_min// Minutes. [0-59]
–int tm_hour// Hours.[0-23]
–int tm_mday// Day.[1-31]
–int tm_mon// Month.[0-11]
–int tm_year// Year -1900
–int tm_wday// Day of week.[0-6]
–int ym_yday// Days in year.[0-365]
#결과 화면
'Computer > System Programing' 카테고리의 다른 글
[Linux] 시스템프로그래밍 기본 (0) | 2013.10.10 |
---|---|
[Linux] ls_basic (0) | 2013.06.21 |