[电脑基础知识]第五章 文件与目录.ppt

  1. 1、本文档共10页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 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 当将一个文件的位置移动时,只是新增一个目录

您可能关注的文档

文档评论(0)

qiwqpu54 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档