![]() |
Created by Ahmad Abdelwahed
over 9 years ago
|
|
The Connection between directories and the shared file is called link.The file system is called Directed Acyclic Graph (DAG).One of the problems from sharing files among directories is maintain the disk address, since the copy of the file will have the same disk address at the beginning but if any directory appended the file its new block will be listed in the directory doing the change. It won't be visible to the other directory.First Solution: The disk block is listed a little data structure associated with the file, and each directory will point to it. The issue with this, the file has one owner if it removes the file, the other directory will point invalid i-node, if the i-node later reassigned to another file then it will point to wrong file.The only thing to do is to remove owner's directory entry, but leave the i-node intact with count set to 1. But the owner will still bill for the file if any accounting or quotas is done.Second Solution: To share a file, the second directory make symbolic link, in which is a new file contains just the path name of the file to which it is linked. When the directory reads from the linked file, the operating system sees that the file being read from LINK, looks up the name of the file, and reads that file. If the owner deleted the file the link will fail since it path name not i-node pointer.Its issue is the overhead to read, parse the path.
Want to create your own Notes for free with GoConqr? Learn more.