Chinaunix首页 | 论坛 | 博客
  • 博客访问: 35466
  • 博文数量: 8
  • 博客积分: 152
  • 博客等级: 入伍新兵
  • 技术积分: 80
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-23 15:02
文章分类
文章存档

2015年(1)

2011年(7)

分类: Python/Ruby

2011-08-16 20:44:55

UNIX uses the same mode bits (1.23) for directories as for files, but they are interpreted differently. This
interpretation will make sense if you remember that a directory is nothing more than a list of files.
Creating a file in a directory, renaming a file or deleting a file from a directory requires changing this list:
therefore, you need write access to the directory to create or delete a file. Modifying a file's contents does
not require you to change the directory; therefore, you can modify files even if you don't have write
access to the directory (providing that you have write access to the file).
Reading a directory is relatively straightforward: you need read access to be able to list the contents of a
directory (find out what files it contains, etc.). If you don't have read access, you can't list the contents of
the directory. However (surprise!) you can still access files in the directory, provided that you already
know their names.
Execute access for a directory has no meaning per se, so the designers of UNIX have reassigned this bit.
It is called the search bit. Search access is needed to perform any operation within a directory and its
subdirectories. In other words, if you deny execute access to a directory, you are effectively denying
access to the directory and everything beneath it in the directory tree.
阅读(1837) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~