# listDir1.py
# Written by Todd Wareham for CS 2500
"""
Print a list (sorted by name) of all readable files in the current
 directory with the size in bytes of each file.
"""

import sys
import os


if len(sys.argv) != 1:
    print "usage:", sys.argv[0]
    sys.exit(1)

for filename in sorted(os.listdir(".")):
    if os.access(filename, os.R_OK) and os.path.isfile(filename):
        print "%-50s [%8d bytes]" % (os.path.abspath(filename), os.path.getsize(filename))
    

