This function converts a file into a structured list for encoding.
Usage
as_file_list(path, name = fs::path_file(path), type = NULL)
Arguments
- path
A character string specifying the file path.
- name
An optional character string specifying the file name.
- type
An optional character string specifying the file type ("text" or "binary").
Value
A structured list representing the file.
Examples
if (FALSE) { # \dontrun{
# Convert a text file to a list
as_file_list("file.txt")
# Convert a binary file to a list
as_file_list("image.jpg", type = "binary")
} # }