- 1、本文档共10页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
[电脑基础知识]第五章 文件与目录
1.UNIX中的文件特点 1 UNIX系统中的文件 1.1 文件的分类 1.1 文件的分类 1.1 文件的分类 1.1 文件的分类 1.1 文件的分类 1.1 文件的分类 1.1 文件的分类 1.1 文件的分类 1.1 文件的分类 1.2 文件的许可机制 1.2 文件的许可机制 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 文件权限 ? S_IRUSR: Read permission, owner ? S_IWUSR: Write permission, owner ? S_IXUSR: Execute permission, owner ? S_IRGRP: Read permission, group ? S_IWGRP: Write permission, group ? S_IXGRP: Execute permission, group ? S_IROTH: Read permission, others ? S_IWOTH: Write permission, others ? S_IXOTH: Execute permission, others Attention Normally, a files current offset must be a non-negative integer. It is possible, however, that certain devices could allow negative offsets. But for regular files, the offset must be non-negative. Because negative offsets are possible, we should be careful to compare the return value from lseek as being equal to or not equal to -1 and not test if its less than 0. 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 4.2 标准输入/输出 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O 2. 文件I/O File Type else if (S_ISBLK(buf.st_mode)) ptr = block special; else if (S_ISFIFO(buf.st_mode)) ptr = fifo; #ifdef S_ISLNK else if (S_ISLNK(buf.st_mode)) ptr = symbolic link; #endif #ifdef S_ISSOCK else if (S_ISSOCK(buf.st_mode)) ptr = socket; #endif else ptr = ** unknown mode **; printf(%s\n, ptr); } exit(0); 3. 文件系统 3. 文件系统 3. 文件系统 3. 文件系统 3. 文件系统 3. 文件系统 We can think of a disk drive being divided into one or more partitions. Each partition can contain a file system。 有两个目录项指向同一个i-node,每个i-node有一个链接数来统计指向该node的目录数。 另外一种连接是 symbolic link,在这种链接文件中,存放的是链接文件指向的文件的文件名。如:目录项的名字是lib,里面的内容是usr/lib: lrwxrwxrwx 1 root 7 Sep 25 07:14 lib - usr/lib 当将一个文件的位置移动时,只是新增一个目录
您可能关注的文档
- [生物学]第七章 蛋白质性质和结构分析_生物信息学.ppt
- [生物学]种子的形成和发育成熟.ppt
- [生物学]第八讲 PCR及其衍生技术在动物传染病防制中的应用.ppt
- [生物学]细胞培养用液简介.ppt
- [生物学]第六章酶分子修饰.ppt
- [生物学]谷氨酸受体神经生物学.ppt
- [生物学]高等植物的个体发育.ppt
- [电脑基础知识]02第2章数据类型1.ppt
- [生物学]裸子植物分类.ppt
- [电脑基础知识]09计算机基础复习题40.pdf
- 第二章 有理数的运算 数学活动课件 (共15张PPT)2024-2025学年人教版数学七年级上册.pptx
- 第二章 有理数的运算 复习与小结课件(共15张PPT) 2024-2025学年人教版数学七年级上册.pptx
- 部编版语文九年级上册 期末复习专题六 文学常识与文化常识 习题课件(共21张PPT).ppt
- 13.3.1 等腰三角形的性质 课件(共27张PPT).pptx
- 4.2整式的加法与减法(第一课时)课件(共15张PPT) 2024-2025学年人教版数学七年级上册.pptx
- 4.2整式的加法与减法(第三课时)课件(共13张PPT) 2024-2025学年人教版数学七年级上册.pptx
- 4.2整式的加法与减法(第二课时)课件 (共13张PPT)2024-2025学年人教版数学七年级上册.pptx
- 4.1整式(第一课时)单项式 课件 (共13张PPT)2024-2025学年人教版数学七年级上册.pptx
- 4.1整式(第二课时)多项式及整式 课件(共14张PPT) 2024-2025学年人教版数学七年级上册.pptx
- 4 古代诗歌四首《天净沙·秋思》课件(共19张PPT).pptx
文档评论(0)