-
大小: 8KB文件類(lèi)型: .c金幣: 1下載: 0 次發(fā)布日期: 2021-01-04
- 標(biāo)簽: Linux??
資源簡(jiǎn)介
Linux下實(shí)現(xiàn)ls命令的-l、-i、-t選項(xiàng) 用c語(yǔ)言實(shí)現(xiàn)。資源內(nèi)容為在Linux系統(tǒng)下可直接運(yùn)行的代碼。
代碼片段和文件信息
/*
********************
Linux下實(shí)現(xiàn)ls命令的-l、-i、-t選項(xiàng)
********************
*/
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
static?bool?flag[4];?//確定命令參數(shù)選項(xiàng)的全局變量
void?derror(const?char?*);
void?dirs(const?char?*bool?flag[]);
void?showlist(const?char?*const?struct?stat?*bool?flag[]);
void?ftype(const?struct?stat?*);
void?fpower(const?struct?stat?*);
void?fpower_char(mode_tmode_tconst?char);
void?getid(const?struct?stat?*);
void?showtime(const?struct?stat?*);
void?derror(const?char?*?ptr)?/*error錯(cuò)誤處理*/
{
????perror(ptr);
????exit(1);
}
void?dirs(const?char?*?pathnamebool?flag[])?/*讀取目錄中的文件*/
{
???ch
評(píng)論
共有 條評(píng)論