摘要:
##mystat 用c语言实现stat ###stat命令的作用 stat命令显示文件或目录的详细属性信息包括文件系统状态,比ls命令输出的信息更详细 首先学习一下stat man stat man -k stat | grep 2 man 2 stat ###伪代码 判断是否包含文件参数 读取结构 阅读全文
摘要:
###代码实现 #include <stdio.h> #include <stdlib.h> #include <utmp.h> #include <fcntl.h> #include <unistd.h> #include <time.h> #define SHOWHOST void show_t 阅读全文
摘要:
###伪代码 打开目录文件 针对目录文件 读取目录条目 显示文件名 关闭文件目录文件 ###实现代码 #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd 阅读全文
摘要:
##第4章 并发编程 ###摘要 论述了并发编程,介绍了并行计算的概念,指出了并行计算的重要性; 比较了顺序算法与并行算法,以及并行性与并发性; 解释了线程的原理及其相对于进程的优势; 介绍了Pthread中的线程操作,包括线程管理函数,互斥量、连接、条件变量和屏障等线程同步工具; 了如何使用线程进 阅读全文