摘要: 1.对于标准I/O库,操作是围绕流进行的。所谓的流,就是一种信息的转换,包括输入流,输出流,错误。即stdin,stdout。error。 【流的定向】读写的字符是多字节的就是宽定向,单字节的就是字节定向。字节定向可以进行清除及修改: 【更改定向类型】 freopen :清除流定向 fwide(FI 阅读全文
posted @ 2016-12-15 17:49 尹盛 阅读(160) 评论(0) 推荐(0)
摘要: 前面的还好,到4.9节卡住了。开始记录一下 1.4.9chmod和fchmod [1]作用:更改现有文件的访问权限。二者区别在于fchmod只能对已打开的文件进行操作。 形式:int chmod(const char *pathname, mode_t mode); int fchmod(int f 阅读全文
posted @ 2016-12-15 16:13 尹盛 阅读(270) 评论(0) 推荐(0)
摘要: 1.对于内核,所有打开或者新创建的文件都通过文件描述符引用。open或者creat获得的文件描述符传递给read或者write做相关函数的第一参数。 【1】open函数,除非创建新的函数带第三个参数,否则都是两个参数。第一个参数代表文件路径名字;第二个是文件状态标志。文件状态标志包括必选的且只能选择 阅读全文
posted @ 2016-12-12 16:18 尹盛 阅读(191) 评论(0) 推荐(0)
摘要: unix高级编程1-1 #include "apue.h"#include <dirent.h>#include <error.h> int main (int argc, char *argv[]){ DIR *dp; struct dirent *dirp; if (argc != 2) 输入的 阅读全文
posted @ 2016-12-08 20:12 尹盛 阅读(142) 评论(0) 推荐(0)
摘要: 发现一本基础的shell脚本教程,只有两个小时时候,先粗略的过一遍大体只是,往后慢慢再仔细学习。 4.条件判断 : 【if】 if [];then elif[];then else fi :正确格式: if空[空-r空“a”空];then 【case】 case "string" in *) ... 阅读全文
posted @ 2016-12-08 20:09 尹盛 阅读(173) 评论(0) 推荐(0)