def files(path):
    "Remove files in path and get remaining space."
    total_size = 0
    # Find all files in directory of path.
    for name in os.listdir(path):
        pathname = os.path.join(path, name)
        if os.path.isfile(pathname):
            # Try to remove any file that may have been found.
            try:
                os.remove(pathname)
            except OSError:
                # If there was an error, try to get the filesize.
                try:
                    total_size += os.path.getsize(pathname)
                except OSError:
                    pass
    # Return best guess of space still occupied.
    return total_size
Remove files in path and get remaining space.
recipes/Python/577635_Directory_Pruner_3/recipe-577635.py