上一页 1 ··· 6 7 8 9 10 11 12 13 14 15 下一页
摘要: 思路:打开一个空文件,不断向文件中写入一个字符,一个字符占一个字节,num++判断info.st_size中是否有数据,一旦有数据,立刻break。 然后输出num. #include<stdlib.h>#include<stdio.h>#include<string.h>#include<erro 阅读全文
posted @ 2016-02-16 11:29 高傲的monkey 阅读(222) 评论(0) 推荐(0)
摘要: #include<stdlib.h>#include<stdio.h>#include<string.h>#include<error.h>#include<errno.h>#include<unistd.h>#include<strings.h>#include<stdbool.h> #inclu 阅读全文
posted @ 2016-02-15 23:17 高傲的monkey 阅读(579) 评论(0) 推荐(0)
摘要: 在使用这个结构体和方法时,需要引入: <sys/types.h> <sys/stat.h> struct stat这个结构体是用来描述一个linux系统文件系统中的文件属性的结构。 可以有两种方法来获取一个文件的属性: 1、通过路径: int stat(const char *path, struc 阅读全文
posted @ 2016-02-15 22:25 高傲的monkey 阅读(611) 评论(0) 推荐(0)
摘要: #include<stdlib.h>#include<stdio.h>#include<string.h>#include<error.h>#include<errno.h>#include<unistd.h>#include<strings.h>#include<stdbool.h> #inclu 阅读全文
posted @ 2016-02-15 18:47 高傲的monkey 阅读(340) 评论(0) 推荐(0)
摘要: #include<stdlib.h>#include<stdio.h>#include<string.h>#include<error.h>#include<errno.h>#include<unistd.h>#include<strings.h>#include<stdbool.h> #inclu 阅读全文
posted @ 2016-02-15 16:10 高傲的monkey 阅读(433) 评论(0) 推荐(0)
摘要: #include<stdlib.h>#include<stdio.h>#include<string.h>#include<error.h>#include<errno.h>#include<unistd.h>#include<strings.h>#include<stdbool.h> #inclu 阅读全文
posted @ 2016-02-15 12:25 高傲的monkey 阅读(499) 评论(0) 推荐(0)
摘要: 1.非指针的操作 char buff[100]; bzero(buff,100);将buff中最开始的n个字节清空; struct stat fileinfo; bzero(&fileinfo, sizeof(fileinfo)); ----------------- struct stat fil 阅读全文
posted @ 2016-02-14 20:43 高傲的monkey 阅读(367) 评论(0) 推荐(0)
摘要: #include<stdlib.h>#include<stdio.h>#include<string.h>#include<error.h>#include<errno.h>#include<unistd.h>#include<strings.h>#include<stdbool.h> #inclu 阅读全文
posted @ 2016-02-14 20:12 高傲的monkey 阅读(359) 评论(0) 推荐(0)
摘要: #include<stdlib.h>#include<stdio.h>#include<string.h>#include<error.h>#include<errno.h>#include<unistd.h>#include<strings.h>#include<stdbool.h> #inclu 阅读全文
posted @ 2016-02-14 19:24 高傲的monkey 阅读(573) 评论(0) 推荐(0)
摘要: #include<stdlib.h>#include<stdio.h>#include<unistd.h>#include<errno.h>#include<error.h>#include<string.h>int main(int argc ,char **argv){ if(argc != 2 阅读全文
posted @ 2016-02-13 20:30 高傲的monkey 阅读(209) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 12 13 14 15 下一页