标题: apue2 4.7题 [打印本页] 作者: uid500 时间: 2008-09-14 18:41 标题: apue2 4.7题 apue2 的第4,7题
Note in output from the ls command in Section 4.12 that the files core and core.copy have different access permissions. If the umask value didn't change between the creation of the two files, explain how the difference could have occurred.
$ cat core > core.copy
$ ls -l core*
-rw-r--r-- 1 sar 8483248 Nov 18 12:18 core
-rw-rw-r-- 1 sar 8483248 Nov 18 12:27 core.copy
$ du -s core*
272 core
16592 core.copy
[ 本帖最后由 liotta 于 2008-9-14 19:19 编辑 ]作者: uid500 时间: 2008-09-14 19:32
Note in output from the ls command in Section 4.12 that the files core and core.copy have different access permissions. If the umask value didn't change between the creation of the two files, explain how the difference could have occurred.
$ cat core > core.copy
$ ls -l core*
-rw-r--r-- 1 sar 8483248 Nov 18 12:18 core
-rw-rw-r-- 1 sar 8483248 Nov 18 12:27 core.copy
$ du -s core*
272 core
16592 core.copy
首先上面的英文部分是书中的原文
$ ls -l core*
-rw-r--r-- 1 sar 8483248 Nov 18 12:18 core
-rw-rw-r-- 1 sar 8483248 Nov 18 12:27 core.copy
这里的core 和core.copy的文件属性变了 core.copy多了一个组可读
我是用的umask 022和文中用的一样但是在我的机子上试验的时候core.copy的属性没有变
[ 本帖最后由 liotta 于 2008-9-14 21:06 编辑 ]作者: insmile 时间: 2008-09-14 21:45
书后面给的答案:4.7 The kernel has a default setting for the file access permission bits when it creates a new core file. In this example, it was rw-r--r--. This default value may or may not be modified by the umask value. The shell also has a default setting for the file access permission bits when it creates a new file for redirection. In this example, it was rw-rw-rw-, and this value is always modified by our current umask. In this example, our umask was 02.作者: uid500 时间: 2008-09-14 22:51
哈哈 谢谢各位了,小第理解了