(self, args)
FILES: output directory listing to screen.
FILES: output directory listing to screen.
FILES : output directory listing to screen .
def files_(self, args):
        """FILES: output directory listing to screen."""
        pathmask = values.next_string(args)
        list(args)
        # pathmask may be left unspecified, but not empty
        if pathmask == b'':
            raise error.BASICError(error.BAD_FILE_NAME)
        elif pathmask is None:
            pathmask = b''
        dev, path = self._get_diskdevice_and_path(pathmask)
        # retrieve files first (to ensure correct path/file not found errors)
        output = dev.listdir(path)
        num_cols = self._console.width // 20
        # output working dir in DOS format
        # NOTE: this is always the current dir, not the one being listed
        self._console.write_line(dev.get_cwd())
        if not output:
            raise error.BASICError(error.FILE_NOT_FOUND)
        # output files
        for i, cols in enumerate(output[j:j+num_cols] for j in xrange(0, len(output), num_cols)):
            self._console.write_line(b' '.join(cols))
            if not (i % 4):
                # allow to break during dir listing & show names flowing on screen
                self._queues.wait()
            i += 1
        self._console.write_line(b' %d Bytes free\n' % dev.get_free())
def files_ ( self , args ) : pathmask = values . next_string ( args ) list ( args ) # pathmask may be left unspecified, but not empty if pathmask == b'' : raise error . BASICError ( error . BAD_FILE_NAME ) elif pathmask is None : pathmask = b'' dev , path = self . _get_diskdevice_and_path ( pathmask ) # retrieve files first (to ensure correct path/file not found errors) output = dev . listdir ( path ) num_cols = self . _console . width // 20 # output working dir in DOS format # NOTE: this is always the current dir, not the one being listed self . _console . write_line ( dev . get_cwd ( ) ) if not output : raise error . BASICError ( error . FILE_NOT_FOUND ) # output files for i , cols in enumerate ( output [ j : j + num_cols ] for j in xrange ( 0 , len ( output ) , num_cols ) ) : self . _console . write_line ( b' ' . join ( cols ) ) if not ( i % 4 ) : # allow to break during dir listing & show names flowing on screen self . _queues . wait ( ) i += 1 self . _console . write_line ( b' %d Bytes free\n' % dev . get_free ( ) )