Removes a specified file from a user's directory on the local file system.
This is a plugin for the `"file"` backend, used via the generic
interface `remove_user_file()`.
Usage
remove_from_file(user_id, file_name, base_dir)
Arguments
- user_id
A string specifying the unique user ID.
- file_name
The name of the file to remove (e.g., `"account_tree.Rds"`).
- base_dir
The root directory containing all user folders. The full
path is constructed as `file.path(base_dir, user_id, file_name)`.
Value
Returns `TRUE` if the file was successfully removed, or `FALSE` if
the file did not exist or could not be removed. A warning is issued if the
file is not found.
Details
If the file does not exist, a warning is issued but no error is thrown.
See also
[save_to_file()], [load_from_file()], [remove_user_file()]
Examples
if (FALSE) { # \dontrun{
remove_from_file("user123", "account_tree.Rds", base_dir = "user_data")
} # }