R/df.R
get_xattr_df.Rd
Retrieve a data frame of xattr names, sizes and (raw) contents for a target path
get_xattr_df(path, follow_symlinks = TRUE) read_xattrs(path, follow_symlinks = TRUE)
path | path target path (file or dir); this is auto-expanded |
---|---|
follow_symlinks | if |
# Create a temp file for the example tf <- tempfile(fileext = ".csv") write.csv(mtcars, tf) # has attributes? (shld be FALSE) has_xattrs(tf)#> [1] FALSE#> character(0)# set an attribute set_xattr(tf, "is.rud.setting.a", "first attribut") get_xattr(tf, "is.rud.setting.a")#> [1] "first attribut"#> [1] 14#> [1] TRUE#> [1] "second attribute"#> [1] 16# overwrite an attribute set_xattr(tf, "is.rud.setting.a", "first attribute") get_xattr(tf, "is.rud.setting.a")#> [1] "first attribute"#> [1] 15#> [1] "is.rud.setting.a" "is.rud.setting.b"# data frame vs individual functions get_xattr_df(tf)#> # A tibble: 2 x 3 #> name size contents #> <chr> <dbl> <list> #> 1 is.rud.setting.a 15 <raw [15]> #> 2 is.rud.setting.b 16 <raw [16]>#> character(0)# cleanup unlink(tf)