(
            self, number, description, filetype, mode=b'I', access=b'', lock=b'',
            reclen=128, seg=0, offset=0, length=0
        )
return new_file
Open a file on a device specified by description.
Open a file on a device specified by description.
Open a file on a device specified by description .
def open(
            self, number, description, filetype, mode=b'I', access=b'', lock=b'',
            reclen=128, seg=0, offset=0, length=0
        ):
        """Open a file on a device specified by description."""
        if (not description) or (number < 0) or (number > self.max_files):
            # bad file number; also for name='', for some reason
            raise error.BASICError(error.BAD_FILE_NUMBER)
        if number in self.files:
            raise error.BASICError(error.FILE_ALREADY_OPEN)
        mode = mode.upper()
        device, dev_param = self._get_device_param(description, mode)
        # get the field buffer
        field = self._memory.fields[number] if number else None
        # open the file on the device
        new_file = device.open(
            number, dev_param, filetype, mode, access, lock,
            reclen, seg, offset, length, field
        )
        logging.debug(
            'Opened file %r as #%d (type %s, mode %s)', dev_param, number, filetype, mode
        )
        if number:
            self.files[number] = new_file
        return new_file
def open ( self , number , description , filetype , mode = b'I' , access = b'' , lock = b'' , reclen = 128 , seg = 0 , offset = 0 , length = 0 ) : if ( not description ) or ( number < 0 ) or ( number > self . max_files ) : # bad file number; also for name='', for some reason raise error . BASICError ( error . BAD_FILE_NUMBER ) if number in self . files : raise error . BASICError ( error . FILE_ALREADY_OPEN ) mode = mode . upper ( ) device , dev_param = self . _get_device_param ( description , mode ) # get the field buffer field = self . _memory . fields [ number ] if number else None # open the file on the device new_file = device . open ( number , dev_param , filetype , mode , access , lock , reclen , seg , offset , length , field ) logging . debug ( 'Opened file %r as #%d (type %s, mode %s)' , dev_param , number , filetype , mode ) if number : self . files [ number ] = new_file return new_file