Skip to contents

Loads a user-specific file (e.g., account tree, lock file) from the localfilesystem.The file format is determined automatically based on its extension.

Usage

load_from_file(user_id, file_name, base_dir)

Arguments

user_id

A character string representing the user's unique identifier.

file_name

The name of the file to load (e.g., `"account_tree.Rds"`, `"data.json"`).

base_dir

The base directory where user data is stored. This should point to the top-level folder containing all user subdirectories.

Value

The loaded object, parsed according to the file extension:

some depedencies:

Details

This function is intended to be called indirectly through a generic loader such as load_user_file, which determines the appropriate backend to use. The file extension determines the parser, and unsupported file types will raise an error.

Examples

if (FALSE) { # \dontrun{
  load_from_file("user123", "account_tree.Rds", base_dir = "user_accounts")
} # }