def METHOD_NAME(my_stack, cur_dir, files_and_dirs):
    "add files to the install list and accumulate files for the uninstall list"
    global counter_dirs, counter_files, stack_of_visited
    counter_dirs += 1
    if just_print_flag:
        print ("here", my_dir)
        return
    # first separate files
    my_files = [x for x in files_and_dirs if os.path.isfile(cur_dir+os.sep+x)]
    # and truncate dir name
    my_dir = cur_dir[len(source_dir):]
    if my_dir=="": my_dir = "\\."
    # save it for uninstall
    stack_of_visited.append( (my_files, my_dir) )
    # build install list
    if len(my_files):
        print >> ih,  inst_dir_tpl % (source_subdir.replace("/","\\") + my_dir.replace("/","\\"))
        for f in my_files:
            print >> ih,  inst_file_tpl % (source_dir,(my_dir+os.sep+f))
            counter_files += 1
        print >> ih, "  "