code: def new_dir(self, vd, name, parent, seqnum, rock_ridge, rr_name, log_block_size,
                  rr_relocated_child, rr_relocated, xa, file_mode):
          '''
          Create a new directory Directory Record.
          Parameters:
           vd - The Volume Descriptor this record is part of.
           name - The name for this directory record.
           parent - The parent of this directory record.
           seqnum - The sequence number for this directory record.
           rock_ridge - Whether to make this a Rock Ridge directory record.
           rr_name - The Rock Ridge name for this directory record.
           log_block_size - The logical block size to use.
           rr_relocated_child - True if this is a Rock Ridge relocated child.
           rr_relocated - True if this is a Rock Ridge relocated entry.
           xa - True if this is an Extended Attribute record.
           file_mode - The POSIX file mode to set for this directory.
          Returns:
           Nothing.
          '''
          if self._initialized:
              raise pycdlibexception.PyCdlibInternalError('Directory Record already initialized')
          self._new(vd, name, parent, seqnum, True, log_block_size, xa)
          if rock_ridge:
              self._rr_new(rock_ridge, rr_name, b'', rr_relocated_child,
                           rr_relocated, False, file_mode)
              if rr_relocated_child and self.rock_ridge:
                  self.isdir = False
                  self.file_flags = 0
                  self.rock_ridge.add_to_file_links()