def __rm_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):
            path_name = os.path.join(path, name)
            if os.path.isfile(path_name):
                # Try to remove any file that may have been found.
                try:
                    os.remove(path_name)
                except OSError:
                    try:
                        # If there was an error, try to get the filesize.
                        total_size += os.path.getsize(path_name)
                    except OSError:
                        pass
        # Return best guess of space still occupied.
        return total_size
Remove files in path and get remaining space.
recipes/Python/577632_Directory_Pruner_1/recipe-577632.py