<s> """<STR_LIT>""" <EOL> import pysmraw <EOL> from dfvfs import dependencies <EOL> from dfvfs . file_io import file_object_io <EOL> from dfvfs . lib import errors <EOL> from dfvfs . lib import raw <EOL> from dfvfs . resolver import resolver <EOL> dependencies . CheckModuleVersion ( u'<STR_LIT>' ) <EOL> class RawFile ( file_object_io . FileObjectIO ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , resolver_context , file_object = None ) : <EOL> """<STR_LIT>""" <EOL> if file_object : <EOL> raise ValueError ( u'<STR_LIT>' ) <EOL> super ( RawFile , self ) . __init__ ( resolver_context ) <EOL> self . _file_objects = [ ] <EOL> def _Close ( self ) : <EOL> """<STR_LIT>""" <EOL> super ( RawFile , self ) . _Close ( ) <EOL> for file_object in self . _file_objects : <EOL> file_object . close ( ) <EOL> self . _file_objects = [ ] <EOL> def _OpenFileObject ( self , path_spec ) : <EOL> """<STR_LIT>""" <EOL> if not path_spec . HasParent ( ) : <EOL> raise errors . PathSpecError ( <EOL> u'<STR_LIT>' ) <EOL> parent_path_spec = path_spec . parent <EOL> file_system = resolver . Resolver . OpenFileSystem ( <EOL> parent_path_spec , resolver_context = self . _resolver_context ) <EOL> segment_file_path_specs = raw . RawGlobPathSpec ( file_system , path_spec ) <EOL> if not segment_file_path_specs : <EOL> return <EOL> if parent_path_spec . IsSystemLevel ( ) : <EOL> self . _resolver_context . SetMaximumNumberOfFileObjects ( <EOL> len ( segment_file_path_specs ) + <NUM_LIT> ) <EOL> file_objects = [ ] <EOL> for segment_file_path_spec in segment_file_path_specs : <EOL> file_object = resolver . Resolver . OpenFileObject ( <EOL> segment_file_path_spec , resolver_context = self . _resolver_context ) <EOL> file_objects . append ( file_object ) <EOL> raw_handle = pysmraw . handle ( ) <EOL> raw_handle . open_file_objects ( file_objects ) <EOL> return raw_handle <EOL> def get_size ( self ) : <EOL> """<STR_LIT>""" <EOL> if not self . _is_open : <EOL> raise IOError ( u'<STR_LIT>' ) <EOL> return self . _file_object . get_media_size ( ) </s>
