as_file_list {dir2json}R 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)

[Package dir2json version 0.1.0 Index]