opendir();------------------------------------------------------------------
readdir();-------------------------------------------------------------------
读取成功是返回结构体类型指针
文件编号(索引号):ino
closedir();-----------------------------------------------------------
---------------------------------------------------------------------------------------------------
ls功能,实现目录名显示
stat();------------------------------------------------
man 2 stat
要准备一个放文件属性的结构体,并取其地址传入
对应00007 (用最后三位来代表others)
判断模式,有两种方法:(1)mode与单个种类相&,不为0即为真 (2)mode与全1(即7)相&,判断是否等于想要的模式
判断wxr,文件使用权限,单个相&,判断是否为0(法一)
法二:判断文件类型,与全1相&,判断是否相等