ACYCLIC-GRAPH DIRECTORIES




           http://raj-os.blogspot.in/   1
Acyclic-Graph Directories
                        Features
• Use a graph structure without any cycles
   – A shared file or subdirectory can be created
   – Which can be used by two or more users
• The above feature is useful where a group of persons
  working for the same project need common
  information


                      http://raj-os.blogspot.in/     2
Acyclic-Graph Directories

Example

  Refer to fig. 1

  The file circled with red mark is a shared file

  It is contained in two subdirectories




                      http://raj-os.blogspot.in/    3
Fig. 1 Acyclic-Graph Directories




        http://raj-os.blogspot.in/   4
Acyclic-Graph Directories
Important

• A shared file or subdirectory will exist in the file
  system in two ( or more ) places at once

• A shared file (or subdirectory) is not the same as two
  copies of the file

• Difference is explained in next slide


                        http://raj-os.blogspot.in/         5
Difference Between Two Copies of the File and
                 Shared File
• With two copies
   – Each user views only the copy, not original
   – If a user changes the file, the changes will not
     appear in the other’s copy
• With a shared file
   – There is only one file
   – Any changes made by one user would be
      automatically available to other users

                       http://raj-os.blogspot.in/       6
Two methods of Implementing Shared Files and
               Subdirectories

1. Create a new directory entry called link

    Used by many UNIX systems

2. Duplicate all information about shared files in both
    sharing directories




                      http://raj-os.blogspot.in/          7
Method 1
• For a shared file the directory entry is marked as a
  link
• A link may be implemented as an absolute path
  name or relative path name ( a symbolic link )
• When a shared file is referenced , the link is resolved
• Links are identified by their special format or by their
  having a special type
• Operating system ignores the links when traversing
  the directory to preserve the acyclic structure


                       http://raj-os.blogspot.in/        8
Method 2

•   Maintain duplicate entries about the shared file in
    all the sharing directories
•   Duplicate entries make the original and copy
    indistinguishable
•   Major problem is maintaining consistency if file
    modified



                        http://raj-os.blogspot.in/        9
Summary

In this class, you have learnt
• Deletion of a directory from tree-structured
   directories
• Advantages and limitations of tree-structured
   directories
• Acyclic-graph directory and its features
• Implementation of shared files



                      http://raj-os.blogspot.in/   10

Acyclic grapch directory 56(2)

  • 1.
    ACYCLIC-GRAPH DIRECTORIES http://raj-os.blogspot.in/ 1
  • 2.
    Acyclic-Graph Directories Features • Use a graph structure without any cycles – A shared file or subdirectory can be created – Which can be used by two or more users • The above feature is useful where a group of persons working for the same project need common information http://raj-os.blogspot.in/ 2
  • 3.
    Acyclic-Graph Directories Example Refer to fig. 1 The file circled with red mark is a shared file It is contained in two subdirectories http://raj-os.blogspot.in/ 3
  • 4.
    Fig. 1 Acyclic-GraphDirectories http://raj-os.blogspot.in/ 4
  • 5.
    Acyclic-Graph Directories Important • Ashared file or subdirectory will exist in the file system in two ( or more ) places at once • A shared file (or subdirectory) is not the same as two copies of the file • Difference is explained in next slide http://raj-os.blogspot.in/ 5
  • 6.
    Difference Between TwoCopies of the File and Shared File • With two copies – Each user views only the copy, not original – If a user changes the file, the changes will not appear in the other’s copy • With a shared file – There is only one file – Any changes made by one user would be automatically available to other users http://raj-os.blogspot.in/ 6
  • 7.
    Two methods ofImplementing Shared Files and Subdirectories 1. Create a new directory entry called link Used by many UNIX systems 2. Duplicate all information about shared files in both sharing directories http://raj-os.blogspot.in/ 7
  • 8.
    Method 1 • Fora shared file the directory entry is marked as a link • A link may be implemented as an absolute path name or relative path name ( a symbolic link ) • When a shared file is referenced , the link is resolved • Links are identified by their special format or by their having a special type • Operating system ignores the links when traversing the directory to preserve the acyclic structure http://raj-os.blogspot.in/ 8
  • 9.
    Method 2 • Maintain duplicate entries about the shared file in all the sharing directories • Duplicate entries make the original and copy indistinguishable • Major problem is maintaining consistency if file modified http://raj-os.blogspot.in/ 9
  • 10.
    Summary In this class,you have learnt • Deletion of a directory from tree-structured directories • Advantages and limitations of tree-structured directories • Acyclic-graph directory and its features • Implementation of shared files http://raj-os.blogspot.in/ 10