| write.access | R Documentation |
Validates whether a file or directory can be accessed for writing. Supports both local and UNC network paths.
write.access(path)
path |
Character string. Full path to file or directory. |
A list of class write_access_result containing:
path - Normalized input path
exists - TRUE/FALSE
type - "File", "Directory", or "New File/Directory"
writable - TRUE/FALSE
status - Overall status message
# Check a temporary directory
result <- write.access(tempdir())
print(result)
# Check an existing temporary file
tmp <- tempfile()
writeLines("hello", tmp)
result <- write.access(tmp)
print(result)
unlink(tmp)
# Check a new file path that does not exist yet
result <- write.access(file.path(tempdir(), "newfile.csv"))
print(result)
# UNC network path (requires network access)
write.access("//server/share/output/results.csv")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.