#NEWLINE# def _Open( self , path_spec = None , mode = 'rb' ) : #NEWLINE# #INDENT# "Opens the file-like object defined by path specification.\n\n    Args:\n      path_spec: optional the path specification (instance of PathSpec).\n      mode: optional file access mode. The default is 'rb' read-only binary.\n\n    Raises:\n      AccessError: if the access to open the file was denied.\n      IOError: if the file-like object could not be opened.\n      PathSpecError: if the path specification is incorrect.\n      ValueError: if the path specification is invalid.\n    " #NEWLINE# if ( not self ) : #NEWLINE# #INDENT# raise ValueError ( 'Missing path specification.' ) #NEWLINE# #UNINDENT# file_system = resolver . Resolver . OpenFileSystem ( path_spec , resolver_context = self . _resolver_context ) #NEWLINE# file_entry = file_system . GetFileEntryByPathSpec ( path_spec ) #NEWLINE# if ( not file_entry ) : #NEWLINE# #INDENT# file_system . Close ( ) #NEWLINE# raise IOError ( 'Unable to retrieve file entry.' ) #NEWLINE# #UNINDENT# self . _file_system = file_system #NEWLINE# self . _cpio_archive_file = self . _file_system . GetCPIOArchiveFile ( ) #NEWLINE# self . _cpio_archive_file_entry = file_entry . GetCPIOArchiveFileEntry ( ) #NEWLINE# self . _current_offset = 0