function file_action(name, directory, modifier)

 if modifier == "execute" then

    -- update dir
    if directory == 1 then
      System.currentDirectory(name)
      update_files()
    end

    -- render files
    render_filelist()

    -- render action info
    if directory == 1 then
      render_statmsg("Changed into directory: " .. name, white)
    else
      render_statmsg("Execute file: " .. name, white)
--      if test_filetype(name, "lua") then
--        confirm_action = "dofile(\"" .. name .. "\")"
--        render_confirm("Run lua script?", white, false)
--      else
        render_alert("LUA only please!", white, false)
--      end
    end

  elseif modifier == "operation" then

    -- render files
    render_filelist()

    -- render file operations
    selected_operation = 1
    render_file_operations(selected_operation)

  end

  -- flip screen
  screen.flip()
  screen.waitVblankStart()

end
