1 Star 0 Fork 0

BESTI.IS.JAVA2018/20165223蔡霓

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ls.c 439 Bytes
一键复制 编辑 原始数据 按行查看 历史
Linux-cai-20165223 提交于 2018-11-11 23:21 +08:00 . 实现ls功能(课下补做)
#include <stdio.h>
#include <syspes.h>
#include <unistd.h>
#include <sys/stat.h>
#include <dirent.h>
#include <string.h>
int main(int argc,char* argv[])
{
DIR* dir = opendir(".");
struct dirent* ent=NULL;
while((ent = readdir(dir)))
{
if((ent->d_type == 4||ent->d_type == 8)&&ent->d_name[0]!='.')
printf("%s ",ent->d_name);
}
closedir(dir);
puts("");
return 0;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/BESTI-IS-JAVA-2018/20165223_cai_ni.git
git@gitee.com:BESTI-IS-JAVA-2018/20165223_cai_ni.git
BESTI-IS-JAVA-2018
20165223_cai_ni
20165223蔡霓
master

搜索帮助