文件管理

来源:互联网 发布:517网络加速器软件源 编辑:程序博客网 时间:2024/06/05 00:48

1.The following figure is a file allocation table in main memory, please write out: which disk blocks does file-A use? Which disk blocks does file B use? Which disk blocks does file C use?


1.下图是主内存中的文件分配表,请写出:文件A使用哪些磁盘快? 文件B使用哪些磁盘块? 文件C使用哪些磁盘块?
这里写图片描述


Answer:
File A uses disk blocks 4, 7, 2, 10 and 12;
File B uses disk blocks 6, 3, 11 and 14;
File C uses disk blocks 8, 0, 9, 1 and 13
这个就根据图片一步一步找就行了,要注意-1表示结束就可以了


2.The beginning of a free space bitmap looks like this after the disk partition is first formatted: 1000 0000 0000 0000 (the first block is used by the root directory). The system always searches for free blocks starting at the lowest-numbered blcok, so after writing file A , which uses six blocks, the bitmap looks like this: 1111 1110 0000 0000. Show the bitmap after each of the following additional actions:
(a) File B is written, using five blocks
(b) File A is deleted
(c) File C is written, using eight blocks
(d) File B is deleted


磁盘分区首次格式化后,可用空间位图的开头如下所示:1000 0000 0000 0000(根目录使用第一个块)。 系统始终搜索从最低编号的blcok开始的空闲块,所以在写入使用六个块的文件A后,位图如下所示:1111 1110 0000 0000.在每个以下其他操作之后显示位图:
(a)文件B写入,使用五个块
(b)文件A被删除
(c)使用八个块写入文件C
(d)文件B被删除


Solution:
(a)1111 1111 1111 0000
(b)1000 0001 1111 0000
(c)1111 1111 1111 1100
(d) 1111 1110 0000 1100
这题没啥可讲的吧


3.Consider the directory tree is as follows. If the working directory is \Root\Alice, the relative path name of file ff1 is .\f1\ff1 , and its absolute path name is \Root\Alice\f1\ff1 . And the relative path name of file ff3 is ..\Bob\f3\ff3 , its absolute path name is \Root\Bob\f3\ff3 .


3.考虑目录树如下。 如果工作目录为\ Root \ Alice,文件ff1的相对路径名为.\ f1 \ ff1,其绝对路径名为\ Root \ Alice \ f1 \ ff1。 而文件ff3的相对路径名为.. \ Bob \ f3 \ ff3,其绝对路径名为\ Root \ Bob \ f3 \ ff3
这里写图片描述
一个”.”表示当前目录下,两个”.”表示上一层目录。

原创粉丝点击