首页 > 试题广场 >

Consider a file system where a

[问答题]
Consider a file system where a file can be deleted and its disk space reclaimed while links to that file still exist. What problems may occur if a new file is created in the same storage area or with the same absolute path name? How can these problems be avoided?
推荐
Let Fl be the old file and F2 be the new file. A user wishing to access Fl through an existing link will actually access F2. Note that the access protection for file Fl is used rather than the one associated with F2.
This problem can be avoided by insuring that all links to a deleted file are deleted also. This can be accomplished in several ways:
a. maintain a list of all links to a file, removing each of them when the file is deleted
b. retain the links, removing them when an attempt is made to access a deleted file
c. maintain a file reference list (or counter), deleting the file only after all links or references to that file have been deleted.
发表于 2018-03-23 21:53:30 回复(0)