摘要: As we saw in the previous section, any file can have multiple directory entries pointing to its i-node. The way we create a link to an existing file is with the link function.#include <unistd.h>int link(const char *existingpath, const char *newpath)Returns: 0 if OK, -1 on errorThis function cr 阅读全文
posted @ 2012-10-09 18:57 beanmoon 阅读(255) 评论(0) 推荐(0) 编辑
摘要: The st_size member of the stat structure contains the size of the file in bytes. This field is meaningful only for regular files, directories, and symbolic links.Solaris also defines the file size for a pipe as the number of bytes that are available for reading from the pipe. We'll discuss pipes 阅读全文
posted @ 2012-10-09 18:11 beanmoon 阅读(306) 评论(0) 推荐(0) 编辑
摘要: Windows 下硬盘安装linux 系统一、启动引导1。光盘安装方式:在BIOS 中设置为CDROM 后,重新启动从光驱启动即可。2。硬盘安装方式:A)从XP 系统安装Linux。在boot.ini 文件(在c 盘根目录,隐藏者的,末尾添加c:\grldr= Linux,保存,如不能保存,把属性的只读去掉),把boot 文件里面第二行的timeout 改为5 或者其他不是零的数字(启动菜单默认选择时间)。然后把grub 解压,把grldr grub.exe 放到C 盘的根目录。1、下载grub4dos,把grub4dos 下的grub.exe 和grldr 复制到C:/。2、从下载的linu 阅读全文
posted @ 2012-10-09 12:57 beanmoon 阅读(998) 评论(0) 推荐(0) 编辑
摘要: 一:准备工作:1:准备所需要的软件。它包括 Centos镜像(DVD)文件和windows版的syslinux.exe文件。2:准备两个操作系统,一个windows,一个linux.windows用来做引导--写 mbr和生成ldlinux.sys;linux用来创建分区、拷贝文件等。3:准备一个4G以上的U盘 为了保险起见我准备一个8个G的U盘,因为考CentOS的ISO文件就需要3.8个G。二:具体的执行步骤:Linux系统上的操作:1.在mnt目录下新建三个目录文件:usb1 ,usb2, iso#mkdir usb1 usb2 iso把CentOS的iso文件挂载到/mnt/iso上# 阅读全文
posted @ 2012-10-09 12:55 beanmoon 阅读(780) 评论(0) 推荐(0) 编辑
摘要: 文件系统特性我们都知道磁盘分区完毕后还需要进行格式化(format),之后操作系统才能够使用这个分割槽。 为什么需要进行『格式化』呢?这是因为每种操作系统所配置的文件属性/权限并不相同, 为了存放这些文件所需的数据,因此就需要将分割槽进行格式化,以成为操作系统能够利用的『文件系统格式(filesystem)』。由此我们也能够知道,每种操作系统能够使用的文件系统并不相同。 举例来说,windows 98 以前的微软操作系统主要利用的文件系统是 FAT (或 FAT16),windows 2000 以后的版本有所谓的 NTFS 文件系统,至于Linux 的正统文件系统则为 Ext2 (Linux 阅读全文
posted @ 2012-10-09 12:46 beanmoon 阅读(1913) 评论(0) 推荐(0) 编辑
摘要: As we described earlier, when we open a file, the kernel performs its access tests based on the effective user and group IDs. There are times when a process wants to test accessibility based on the real user and group IDs. This is useful when a process is running as someone else, using either the se 阅读全文
posted @ 2012-10-07 18:59 beanmoon 阅读(357) 评论(0) 推荐(0) 编辑
摘要: Set UID当 s 这个标志出现在文件拥有者的 x 权限上时,例如刚刚提到的 /usr/bin/passwd 这个文件的权限状态:『-rwsr-xr-x』,此时就被称为 Set UID,简称为 SUID 的特殊权限。 那么SUID的权限对於一个文件的特殊功能是什么呢?基本上SUID有这样的限制与功能:SUID 权限仅对二进位程序(binary program)有效;运行者对於该程序需要具有 x 的可运行权限;本权限仅在运行该程序的过程中有效 (run-time);运行者将具有该程序拥有者 (owner) 的权限。讲这么硬的东西你可能对於 SUID 还是没有概念,没关系,我们举个例子来说明好了 阅读全文
posted @ 2012-10-07 18:35 beanmoon 阅读(404) 评论(0) 推荐(0) 编辑
摘要: The user ID of a new file is set to the effective user ID of the process. POSIX.1 allows an implementation to choose one of the following options to determine the group ID of a new file.The group ID of a new file can be the effective group ID of the process.The group ID of a new file can be the grou 阅读全文
posted @ 2012-10-07 18:27 beanmoon 阅读(156) 评论(0) 推荐(0) 编辑
摘要: In the UNIX System, privileges, such as being able to change the system's notion of the current date, and access control, such as being able to read or write a particular file, are based on user and group IDs. When our programs need additional privileges or need to gain access to resources that 阅读全文
posted @ 2012-10-07 17:49 beanmoon 阅读(312) 评论(0) 推荐(0) 编辑
摘要: The three categories in Figure 4.6read, write, and execute are used in various ways by different functions. We'll summarize them here, and return to them when we describe the actual functions. Figure 4.6. The nine file access permission bits, from <sys/stat.h> st_mode maskMeani... 阅读全文
posted @ 2012-10-07 00:03 beanmoon 阅读(421) 评论(0) 推荐(0) 编辑