def dir(args):
    """dir directory_name ...
    Perform a directory listing on the remote device
    """
    bRecurse = 0
    try:
        opts, args = getopt.getopt(args, "r")
    except getopt.error, details:
        raise InvalidUsage(details)
    for o, v in opts:
        if o=="-r":
            bRecurse=1
    for arg in args:
        print "Directory of WCE:%s" % arg
        files = BuildFileList(arg, 0, bRecurse, _dirfilter, None)
        total_size=0
        for full_name, info, rel_name in files:
            date_str = info[3].Format("%d-%b-%Y %H:%M")
            attr_string = "     "
            if info[0] & win32con.FILE_ATTRIBUTE_DIRECTORY: attr_string = "<DIR>"
            print "%s  %s %10d %s" % (date_str, attr_string, info[5], rel_name)
            total_size = total_size + info[5]
        print " " * 14 + "%3d files, %10d bytes" % (len(files), total_size)
dataset/ETHPy150Open deanhiller/databus/webapp/play1.3.x/python/Lib/site-packages/win32/scripts/ce/pysynch.py/dir/original