摘要: 摘自:文心一言 在C语言中,可以使用stat()函数来判断一个路径对应的是文件、文件夹或者其他类型。 #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> int main() { char path[] = "/path/t 阅读全文
posted @ 2024-02-05 10:39 LiuYanYGZ 阅读(26) 评论(0) 推荐(0) 编辑
摘要: 摘自:https://forum.ubuntu.org.cn/viewtopic.php?t=380854 我在学习linux C系统编程,书上有个源代码可以实现自己的ls命令,不过在查错的过程中这个问题卡了我很久 #include <stdio.h> #include <stdlib.h> #in 阅读全文
posted @ 2024-02-05 10:24 LiuYanYGZ 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 摘自:https://blog.csdn.net/m0_38062470/article/details/113574697 #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> int stat(const char *p 阅读全文
posted @ 2024-02-05 10:23 LiuYanYGZ 阅读(2) 评论(0) 推荐(0) 编辑