as_file_list: Convert a File to a List

View source: R/encode_decode.R

as_file_listR Documentation

Convert a File to a List

Description

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

## Not run: 
# 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")

## End(Not run)

dir2json documentation built on June 8, 2025, 11:31 a.m.