Learn R Programming

btw (version 1.0.0)

btw_tool_files_list_files: Tool: List files

Description

Tool: List files

Usage

btw_tool_files_list_files(
  path = NULL,
  type = c("any", "file", "directory"),
  regexp = "",
  `_intent` = ""
)

Value

Returns a character table of file information.

Arguments

path

Path to a directory or file for which to get information. The path must be in the current working directory. If path is a directory, we use fs::dir_info() to list information about files and directories in path (use type to pick only one or the other). If path is a file, we show information about that file.

type

File type(s) to return, one of "any" or "file" or "directory".

regexp

A regular expression (e.g. [.]csv$) passed on to grep() to filter paths.

_intent

An optional string describing the intent of the tool use. When the tool is used by an LLM, the model will use this argument to explain why it called the tool.

See Also

Other Tools: btw_tool_docs_package_news(), btw_tool_env_describe_data_frame(), btw_tool_env_describe_environment(), btw_tool_files_code_search(), btw_tool_files_read_text_file(), btw_tool_files_write_text_file(), btw_tool_ide_read_current_editor(), btw_tool_package_docs, btw_tool_search_packages(), btw_tool_session_package_info(), btw_tool_session_platform_info(), btw_tool_web_read_url(), btw_tools()

Examples

Run this code
withr::with_tempdir({
  write.csv(mtcars, "mtcars.csv")

  btw_tool_files_list_files(type = "file")
})

Run the code above in your browser using DataLab