Read the .zattrs file associated with a Zarr array or group
Source:R/write_metadata.R
write_zarr_attributes.RdRead the .zattrs file associated with a Zarr array or group
Usage
write_zarr_attributes(zarr_path, new.zattrs = list(), overwrite = TRUE)Value
Invisibly, the updated attributes as a named list.
This is equivalent to (but faster than) using read_zarr_attributes() after writing.
If no attributes were present before, this is identical to new.zattrs.
Examples
z1 <- withr::local_tempdir(fileext = ".zarr")
write_zarr_attributes(z1, list(date = "2025-01-01", author = "Jane Doe"))
#> Warning: cannot open file '/tmp/RtmpjcOuAj/file1fea6e4cebe9.zarr/.zattrs': No such file or directory
#> Error in file(con, "w"): cannot open the connection