diff --git a/dev/pkgdown.yml b/dev/pkgdown.yml index 843a2eca..631000ae 100644 --- a/dev/pkgdown.yml +++ b/dev/pkgdown.yml @@ -3,7 +3,7 @@ pkgdown: 2.1.1 pkgdown_sha: ~ articles: function-comparisons: function-comparisons.html -last_built: 2024-10-25T22:26Z +last_built: 2024-10-27T09:44Z urls: reference: https://fs.r-lib.org/reference article: https://fs.r-lib.org/articles diff --git a/dev/reference/copy.html b/dev/reference/copy.html index 575c2f77..17f7dc0f 100644 --- a/dev/reference/copy.html +++ b/dev/reference/copy.html @@ -114,10 +114,10 @@

Examples# Create a link to the directory link_create(path_abs("foo"), "loo") link_path("loo") -#> /tmp/RtmpDSF2Zg/foo +#> /tmp/RtmpA3FOoQ/foo link_copy("loo", "loo2") link_path("loo2") -#> /tmp/RtmpDSF2Zg/foo +#> /tmp/RtmpA3FOoQ/foo # Cleanup dir_delete(c("foo", "foo2")) diff --git a/dev/reference/delete.html b/dev/reference/delete.html index 278e1ede..73f07893 100644 --- a/dev/reference/delete.html +++ b/dev/reference/delete.html @@ -107,7 +107,7 @@

Examples#> link #> TRUE file_exists(link_path("link")) -#> /tmp/RtmpDSF2Zg/dir +#> /tmp/RtmpA3FOoQ/dir #> TRUE # Delete a file @@ -130,7 +130,7 @@

Examples#> link #> TRUE dir_exists(link_path("link")) -#> /tmp/RtmpDSF2Zg/dir +#> /tmp/RtmpA3FOoQ/dir #> FALSE # Delete the link diff --git a/dev/reference/dir_ls.html b/dev/reference/dir_ls.html index 0710255c..45cbdf0c 100644 --- a/dev/reference/dir_ls.html +++ b/dev/reference/dir_ls.html @@ -186,10 +186,10 @@

Examples # If you need the full paths input an absolute path dir_ls(path_abs("base")) -#> /tmp/RtmpDSF2Zg/base/CITATION /tmp/RtmpDSF2Zg/base/DESCRIPTION -#> /tmp/RtmpDSF2Zg/base/INDEX /tmp/RtmpDSF2Zg/base/Meta -#> /tmp/RtmpDSF2Zg/base/R /tmp/RtmpDSF2Zg/base/demo -#> /tmp/RtmpDSF2Zg/base/help /tmp/RtmpDSF2Zg/base/html +#> /tmp/RtmpA3FOoQ/base/CITATION /tmp/RtmpA3FOoQ/base/DESCRIPTION +#> /tmp/RtmpA3FOoQ/base/INDEX /tmp/RtmpA3FOoQ/base/Meta +#> /tmp/RtmpA3FOoQ/base/R /tmp/RtmpA3FOoQ/base/demo +#> /tmp/RtmpA3FOoQ/base/help /tmp/RtmpA3FOoQ/base/html dir_map("base", identity) #> [[1]] @@ -234,11 +234,11 @@

Examples#> 1 base/CITATION file 643 rw-r--r-- 2024-08-22 01:58:33 root root #> 2 …se/DESCRIPTION file 383 rw-r--r-- 2024-08-22 01:58:33 root root #> 3 base/INDEX file 24.2K rw-r--r-- 2024-08-22 01:58:33 root root -#> 4 base/Meta dire… 4K rwxr-xr-x 2024-10-25 22:25:12 root root -#> 5 base/R dire… 4K rwxr-xr-x 2024-10-25 22:25:12 root root -#> 6 base/demo dire… 4K rwxr-xr-x 2024-10-25 22:25:12 root root -#> 7 base/help dire… 4K rwxr-xr-x 2024-10-25 22:25:12 root root -#> 8 base/html dire… 4K rwxr-xr-x 2024-10-25 22:25:12 root root +#> 4 base/Meta dire… 4K rwxr-xr-x 2024-10-27 09:43:27 root root +#> 5 base/R dire… 4K rwxr-xr-x 2024-10-27 09:43:27 root root +#> 6 base/demo dire… 4K rwxr-xr-x 2024-10-27 09:43:27 root root +#> 7 base/help dire… 4K rwxr-xr-x 2024-10-27 09:43:27 root root +#> 8 base/html dire… 4K rwxr-xr-x 2024-10-27 09:43:27 root root #> # ℹ 11 more variables: device_id <dbl>, hard_links <dbl>, #> # special_device_id <dbl>, inode <dbl>, block_size <dbl>, blocks <dbl>, #> # flags <int>, generation <dbl>, access_time <dttm>, diff --git a/dev/reference/file_info.html b/dev/reference/file_info.html index e419093b..b93ef471 100644 --- a/dev/reference/file_info.html +++ b/dev/reference/file_info.html @@ -151,7 +151,7 @@

Examples#> # A tibble: 1 × 18 #> path type size permissions modification_time user group #> <fs::path> <fct> <fs::bytes> <fs::perms> <dttm> <chr> <chr> -#> 1 mtcars.csv file 1.74K rw-r--r-- 2024-10-25 22:26:12 runn… dock… +#> 1 mtcars.csv file 1.74K rw-r--r-- 2024-10-27 09:44:30 runn… dock… #> # ℹ 11 more variables: device_id <dbl>, hard_links <dbl>, #> # special_device_id <dbl>, inode <dbl>, block_size <dbl>, blocks <dbl>, #> # flags <int>, generation <dbl>, access_time <dttm>, diff --git a/dev/reference/file_temp.html b/dev/reference/file_temp.html index 8ebe1f7b..e8b479aa 100644 --- a/dev/reference/file_temp.html +++ b/dev/reference/file_temp.html @@ -96,16 +96,16 @@

DetailsExamples


 path_temp()
-#> /tmp/RtmpDSF2Zg
+#> /tmp/RtmpA3FOoQ
 path_temp("does-not-exist")
-#> /tmp/RtmpDSF2Zg/does-not-exist
+#> /tmp/RtmpA3FOoQ/does-not-exist
 
 file_temp()
 #> /tmp/filedd461c46df20
 file_temp(ext = "png")
-#> /tmp/RtmpDSF2Zg/file26554a766ee6.png
+#> /tmp/RtmpA3FOoQ/file264717315cf8.png
 file_temp("image", ext = "png")
-#> /tmp/RtmpDSF2Zg/image265549d8da87.png
+#> /tmp/RtmpA3FOoQ/image264754203c97.png
 
 
 # You can make the temp file paths deterministic
diff --git a/dev/reference/file_touch.html b/dev/reference/file_touch.html
index e85735b3..06ce5587 100644
--- a/dev/reference/file_touch.html
+++ b/dev/reference/file_touch.html
@@ -76,7 +76,7 @@ 

Examples#> # A tibble: 1 × 4 #> access_time modification_time change_time #> <dttm> <dttm> <dttm> -#> 1 2018-01-01 00:00:00 2018-01-01 00:00:00 2024-10-25 22:26:12 +#> 1 2018-01-01 00:00:00 2018-01-01 00:00:00 2024-10-27 09:44:31 #> # ℹ 1 more variable: birth_time <dttm>

diff --git a/dev/reference/link_path.html b/dev/reference/link_path.html index 3f4bd019..54136b83 100644 --- a/dev/reference/link_path.html +++ b/dev/reference/link_path.html @@ -69,7 +69,7 @@

Examples
file_create("foo")
 link_create(path_abs("foo"), "bar")
 link_path("bar")
-#> /tmp/RtmpDSF2Zg/foo
+#> /tmp/RtmpA3FOoQ/foo
 
 # Cleanup
 file_delete(c("foo", "bar"))
diff --git a/dev/reference/path_math.html b/dev/reference/path_math.html
index 05820bd2..88f4329b 100644
--- a/dev/reference/path_math.html
+++ b/dev/reference/path_math.html
@@ -127,7 +127,7 @@ 

Examples # Realize the path path_real("c/b") -#> /tmp/RtmpDSF2Zg/a/b +#> /tmp/RtmpA3FOoQ/a/b # Split a path parts <- path_split("a/b") diff --git a/dev/search.json b/dev/search.json index 64e5fa1c..79bc4759 100644 --- a/dev/search.json +++ b/dev/search.json @@ -1 +1 @@ -[{"path":[]},{"path":"https://fs.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://fs.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://fs.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://fs.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://fs.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement codeofconduct@posit.co. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://fs.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://fs.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://fs.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://fs.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://fs.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://fs.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.1, available https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. Community Impact Guidelines inspired [Mozilla’s code conduct enforcement ladder][https://github.com/mozilla/inclusion]. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"https://fs.r-lib.org/dev/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2023 fs authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://fs.r-lib.org/dev/MAINTENANCE.html","id":"current-state","dir":"","previous_headings":"","what":"Current state","title":"NA","text":"fs generally stable new development pretty rare.","code":""},{"path":"https://fs.r-lib.org/dev/MAINTENANCE.html","id":"known-outstanding-issues","dir":"","previous_headings":"","what":"Known outstanding issues","title":"NA","text":"Fairly often someone run problems compiling fs due autotools / configure problems libuv dependency. don’t great suggestions work arounds things, maybe harmonizing Makevars one httuv, also needs compile libuv. https://github.com/rstudio/httpuv/blob/main/src/Makevars outstanding issue around networked drive shares / UNC paths windows, e.g. (https://github.com/r-lib/fs/issues/296, https://github.com/r-lib/fs/issues/223, https://github.com/r-lib/fs/issues/147) partially stem deficiencies OS APIs fs node package ended going back javascript implementation avoid issues.","code":""},{"path":[]},{"path":[]},{"path":[]},{"path":"https://fs.r-lib.org/dev/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Jim Hester. Author. Hadley Wickham. Author. Gábor Csárdi. Author, maintainer. libuv project contributors. Copyright holder. libuv library Joyent, Inc. Node contributors. Copyright holder. libuv library . Copyright holder, funder.","code":""},{"path":"https://fs.r-lib.org/dev/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Hester J, Wickham H, Csárdi G (2024). fs: Cross-Platform File System Operations Based 'libuv'. R package version 1.6.4.9000, https://github.com/r-lib/fs, https://fs.r-lib.org.","code":"@Manual{, title = {fs: Cross-Platform File System Operations Based on 'libuv'}, author = {Jim Hester and Hadley Wickham and Gábor Csárdi}, year = {2024}, note = {R package version 1.6.4.9000, https://github.com/r-lib/fs}, url = {https://fs.r-lib.org}, }"},{"path":"https://fs.r-lib.org/dev/index.html","id":"fs-","dir":"","previous_headings":"","what":"Cross-Platform File System Operations Based on libuv","title":"Cross-Platform File System Operations Based on libuv","text":"fs provides cross-platform, uniform interface file system operations. shares back-end component nodejs, libuv C library, brings benefit extensive real-world use rigorous cross-platform testing. name, interface, partially inspired Rust’s fs module.","code":""},{"path":"https://fs.r-lib.org/dev/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Cross-Platform File System Operations Based on libuv","text":"can install released version fs CRAN : development version GitHub :","code":"install.packages(\"fs\") pak::pak(\"r-lib/fs\")"},{"path":"https://fs.r-lib.org/dev/index.html","id":"comparison-vs-base-equivalents","dir":"","previous_headings":"","what":"Comparison vs base equivalents","title":"Cross-Platform File System Operations Based on libuv","text":"fs functions smooth idiosyncrasies file handling base R functions: Vectorization. fs functions vectorized, accepting multiple paths input. Base functions inconsistently vectorized. Predictable return values always convey path. fs functions return character vector paths, named integer logical vector, names give paths. Base return values varied: often logical contain error codes require downstream processing. Explicit failure. fs operations fail, throw error. Base functions tend generate warning system dependent error code. makes easy miss failure. UTF-8 things. fs functions always convert input paths UTF-8 return results UTF-8. gives path encoding consistency across OSes. Base functions rely native system encoding. Naming convention. fs functions use consistent naming convention. base R’s functions gradually added time number different conventions used (e.g. path.expand() vs normalizePath(); Sys.chmod() vs file.access()).","code":""},{"path":"https://fs.r-lib.org/dev/index.html","id":"tidy-paths","dir":"","previous_headings":"Comparison vs base equivalents","what":"Tidy paths","title":"Cross-Platform File System Operations Based on libuv","text":"fs functions always return ‘tidy’ paths. Tidy paths Always use / delimit directories never multiple / trailing / Tidy paths also coloured (terminal supports ) based file permissions file type. colouring can customized extended setting LS_COLORS environment variable, output format GNU dircolors.","code":""},{"path":"https://fs.r-lib.org/dev/index.html","id":"usage","dir":"","previous_headings":"","what":"Usage","title":"Cross-Platform File System Operations Based on libuv","text":"fs functions divided four main categories: path_ manipulating constructing paths file_ files dir_ directories link_ links Directories links special types files, file_ functions generally also work applied directory link. fs designed work well pipe, though minimal-dependency infrastructure package doesn’t provide pipe . need attach magrittr similar. fs functions also work well conjunction tidyverse packages, like dplyr purrr. examples… Filter files type, permission size Tabulate display folder size. Read collection files one data frame. dir_ls() returns named vector, can used directly purrr::map_df(.id).","code":"library(fs) # Construct a path to a file with `path()` path(\"foo\", \"bar\", letters[1:3], ext = \"txt\") #> foo/bar/a.txt foo/bar/b.txt foo/bar/c.txt # list files in the current directory dir_ls() #> DESCRIPTION LICENSE LICENSE.md MAINTENANCE.md #> NAMESPACE NEWS.md R README.Rmd #> README.md _pkgdown.yml cleanup codecov.yml #> cran-comments.md fs.Rproj inst man #> man-roxygen src tests vignettes # create a new directory tmp <- dir_create(file_temp()) tmp #> /var/folders/ph/fpcmzfd16rgbbk8mxvy9m2_h0000gn/T/RtmpxNODwI/file5e375b43f7c8 # create new files in that directory file_create(path(tmp, \"my-file.txt\")) dir_ls(tmp) #> /var/folders/ph/fpcmzfd16rgbbk8mxvy9m2_h0000gn/T/RtmpxNODwI/file5e375b43f7c8/my-file.txt # remove files from the directory file_delete(path(tmp, \"my-file.txt\")) dir_ls(tmp) #> character(0) # remove the directory dir_delete(tmp) library(magrittr) paths <- file_temp() %>% dir_create() %>% path(letters[1:5]) %>% file_create() paths #> /var/folders/ph/fpcmzfd16rgbbk8mxvy9m2_h0000gn/T/RtmpxNODwI/file5e377e50d1e9/a #> /var/folders/ph/fpcmzfd16rgbbk8mxvy9m2_h0000gn/T/RtmpxNODwI/file5e377e50d1e9/b #> /var/folders/ph/fpcmzfd16rgbbk8mxvy9m2_h0000gn/T/RtmpxNODwI/file5e377e50d1e9/c #> /var/folders/ph/fpcmzfd16rgbbk8mxvy9m2_h0000gn/T/RtmpxNODwI/file5e377e50d1e9/d #> /var/folders/ph/fpcmzfd16rgbbk8mxvy9m2_h0000gn/T/RtmpxNODwI/file5e377e50d1e9/e paths %>% file_delete() suppressMessages( library(tidyverse)) dir_info(\"src\", recurse = FALSE) %>% filter(type == \"file\", permissions == \"u+r\", size > \"10KB\") %>% arrange(desc(size)) %>% select(path, permissions, size, modification_time) #> # A tibble: 12 × 4 #> path permissions size modification_time #> #> 1 src/fs.so rwxr-xr-x 309.3K 2023-07-10 18:01:44 #> 2 src/id.o rw-r--r-- 185.7K 2023-07-10 18:01:17 #> 3 src/dir.o rw-r--r-- 115.1K 2023-07-10 18:01:16 #> 4 src/path.o rw-r--r-- 113.6K 2023-07-10 18:01:18 #> 5 src/link.o rw-r--r-- 91.6K 2023-07-10 18:01:18 #> 6 src/getmode.o rw-r--r-- 83.1K 2023-07-10 18:01:17 #> 7 src/utils.o rw-r--r-- 80.8K 2023-07-10 18:01:18 #> 8 src/file.o rw-r--r-- 66.1K 2023-07-10 18:01:17 #> 9 src/init.o rw-r--r-- 20.4K 2023-07-10 18:01:17 #> 10 src/error.o rw-r--r-- 20.1K 2023-07-10 18:01:16 #> 11 src/fs.o rw-r--r-- 12K 2023-07-10 18:01:17 #> 12 src/file.cc rw-r--r-- 11.7K 2023-07-10 17:54:06 dir_info(\"src\", recurse = TRUE) %>% group_by(directory = path_dir(path)) %>% tally(wt = size, sort = TRUE) #> # A tibble: 14 × 2 #> directory n #> #> 1 src/libuv-1.44.2 2.87M #> 2 src/libuv-1.44.2/src/unix 1.46M #> 3 src 1.11M #> 4 src/libuv-1.44.2/test 1.05M #> 5 src/libuv-1.44.2/src/win 742.07K #> 6 src/libuv-1.44.2/m4 356.7K #> 7 src/libuv-1.44.2/src 353.05K #> 8 src/libuv-1.44.2/include/uv 137.44K #> 9 src/libuv-1.44.2/img 106.71K #> 10 src/unix 76.56K #> 11 src/libuv-1.44.2/include 66.23K #> 12 src/bsd 20.02K #> 13 src/windows 4.73K #> 14 src/libuv-1.44.2/test/fixtures 453 # Create separate files for each species iris %>% split(.$Species) %>% map(select, -Species) %>% iwalk(~ write_tsv(.x, paste0(.y, \".tsv\"))) # Show the files iris_files <- dir_ls(glob = \"*.tsv\") iris_files #> setosa.tsv versicolor.tsv virginica.tsv # Read the data into a single table, including the filenames iris_files %>% map_df(read_tsv, .id = \"file\", col_types = cols(), n_max = 2) #> # A tibble: 6 × 5 #> file Sepal.Length Sepal.Width Petal.Length Petal.Width #> #> 1 setosa.tsv 5.1 3.5 1.4 0.2 #> 2 setosa.tsv 4.9 3 1.4 0.2 #> 3 versicolor.tsv 7 3.2 4.7 1.4 #> 4 versicolor.tsv 6.4 3.2 4.5 1.5 #> 5 virginica.tsv 6.3 3.3 6 2.5 #> 6 virginica.tsv 5.8 2.7 5.1 1.9 file_delete(iris_files)"},{"path":"https://fs.r-lib.org/dev/index.html","id":"feedback-wanted","dir":"","previous_headings":"","what":"Feedback wanted!","title":"Cross-Platform File System Operations Based on libuv","text":"hope fs useful tool analysis scripts packages. Please open GitHub issues feature requests bugs. particular, found non-ASCII filenames non-English locales Windows especially tricky reproduce handle correctly. Feedback users use commonly situation greatly appreciated.","code":""},{"path":"https://fs.r-lib.org/dev/index.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Cross-Platform File System Operations Based on libuv","text":"Please note fs project released Contributor Code Conduct. contributing project, agree abide terms.","code":""},{"path":"https://fs.r-lib.org/dev/reference/copy.html","id":null,"dir":"Reference","previous_headings":"","what":"Copy files, directories or links — copy","title":"Copy files, directories or links — copy","text":"file_copy() copies files. link_copy() creates new link pointing location previous link. dir_copy() copies directory recursively new location.","code":""},{"path":"https://fs.r-lib.org/dev/reference/copy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Copy files, directories or links — copy","text":"","code":"file_copy(path, new_path, overwrite = FALSE) dir_copy(path, new_path, overwrite = FALSE) link_copy(path, new_path, overwrite = FALSE)"},{"path":"https://fs.r-lib.org/dev/reference/copy.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Copy files, directories or links — copy","text":"path character vector one paths. new_path character vector paths new locations. overwrite Overwrite files exist. FALSE file exists error thrown.","code":""},{"path":"https://fs.r-lib.org/dev/reference/copy.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Copy files, directories or links — copy","text":"new path (invisibly).","code":""},{"path":"https://fs.r-lib.org/dev/reference/copy.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Copy files, directories or links — copy","text":"behavior dir_copy() differs slightly file.copy() overwrite = TRUE. directory always copied new_path, even name differs basename path.","code":""},{"path":"https://fs.r-lib.org/dev/reference/copy.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Copy files, directories or links — copy","text":"","code":"file_create(\"foo\") file_copy(\"foo\", \"bar\") try(file_copy(\"foo\", \"bar\")) #> Error : [EEXIST] Failed to copy 'foo' to 'bar': file already exists file_copy(\"foo\", \"bar\", overwrite = TRUE) file_delete(c(\"foo\", \"bar\")) dir_create(\"foo\") # Create a directory and put a few files in it files <- file_create(c(\"foo/bar\", \"foo/baz\")) file_exists(files) #> foo/bar foo/baz #> TRUE TRUE # Copy the directory dir_copy(\"foo\", \"foo2\") file_exists(path(\"foo2\", path_file(files))) #> foo2/bar foo2/baz #> TRUE TRUE # Create a link to the directory link_create(path_abs(\"foo\"), \"loo\") link_path(\"loo\") #> /tmp/RtmpDSF2Zg/foo link_copy(\"loo\", \"loo2\") link_path(\"loo2\") #> /tmp/RtmpDSF2Zg/foo # Cleanup dir_delete(c(\"foo\", \"foo2\")) link_delete(c(\"loo\", \"loo2\"))"},{"path":"https://fs.r-lib.org/dev/reference/create.html","id":null,"dir":"Reference","previous_headings":"","what":"Create files, directories, or links — create","title":"Create files, directories, or links — create","text":"functions file_create() dir_create() ensure path exists; already exists left unchanged. means compared file.create(), file_create() truncate existing file, compared dir.create(), dir_create() silently ignore existing directories.","code":""},{"path":"https://fs.r-lib.org/dev/reference/create.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create files, directories, or links — create","text":"","code":"file_create(path, ..., mode = \"u=rw,go=r\") dir_create(path, ..., mode = \"u=rwx,go=rx\", recurse = TRUE, recursive) link_create(path, new_path, symbolic = TRUE)"},{"path":"https://fs.r-lib.org/dev/reference/create.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create files, directories, or links — create","text":"path character vector one paths. link_create(), target. ... Additional arguments passed path() mode file/directory created, mode ? Links mode; inherit mode file link . recurse intermediate directories created exist? recursive (Deprecated) TRUE recurse fully. new_path path link created. symbolic Boolean value determining link symbolic (default) hard link.","code":""},{"path":"https://fs.r-lib.org/dev/reference/create.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create files, directories, or links — create","text":"path created object (invisibly).","code":""},{"path":"https://fs.r-lib.org/dev/reference/create.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create files, directories, or links — create","text":"","code":"file_create(\"foo\") is_file(\"foo\") #> foo #> TRUE # dir_create applied to the same path will fail try(dir_create(\"foo\")) #> Error : [EEXIST] Failed to make directory 'foo': file already exists dir_create(\"bar\") is_dir(\"bar\") #> bar #> TRUE # file_create applied to the same path will fail try(file_create(\"bar\")) #> Error : [EISDIR] Failed to open 'bar': illegal operation on a directory # Cleanup file_delete(\"foo\") dir_delete(\"bar\")"},{"path":"https://fs.r-lib.org/dev/reference/delete.html","id":null,"dir":"Reference","previous_headings":"","what":"Delete files, directories, or links — delete","title":"Delete files, directories, or links — delete","text":"file_delete() link_delete() delete file links. Compared file.remove always fail delete object rather changing return value signalling warning. inputs directories, passed dir_delete(), file_delete() can therefore used delete filesystem object. dir_delete() first delete contents directory, remove directory. Compared unlink always throw error directory deleted rather silent signalling warning.","code":""},{"path":"https://fs.r-lib.org/dev/reference/delete.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Delete files, directories, or links — delete","text":"","code":"file_delete(path) dir_delete(path) link_delete(path)"},{"path":"https://fs.r-lib.org/dev/reference/delete.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Delete files, directories, or links — delete","text":"path character vector one paths.","code":""},{"path":"https://fs.r-lib.org/dev/reference/delete.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Delete files, directories, or links — delete","text":"deleted paths (invisibly).","code":""},{"path":"https://fs.r-lib.org/dev/reference/delete.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Delete files, directories, or links — delete","text":"","code":"# create a directory, with some files and a link to it dir_create(\"dir\") files <- file_create(path(\"dir\", letters[1:5])) link <- link_create(path_abs(\"dir\"), \"link\") # All files created dir_exists(\"dir\") #> dir #> TRUE file_exists(files) #> dir/a dir/b dir/c dir/d dir/e #> TRUE TRUE TRUE TRUE TRUE link_exists(\"link\") #> link #> TRUE file_exists(link_path(\"link\")) #> /tmp/RtmpDSF2Zg/dir #> TRUE # Delete a file file_delete(files[1]) file_exists(files[1]) #> dir/a #> FALSE # Delete the directory (which deletes the files as well) dir_delete(\"dir\") file_exists(files) #> dir/a dir/b dir/c dir/d dir/e #> FALSE FALSE FALSE FALSE FALSE dir_exists(\"dir\") #> dir #> FALSE # The link still exists, but what it points to does not. link_exists(\"link\") #> link #> TRUE dir_exists(link_path(\"link\")) #> /tmp/RtmpDSF2Zg/dir #> FALSE # Delete the link link_delete(\"link\") link_exists(\"link\") #> link #> FALSE"},{"path":"https://fs.r-lib.org/dev/reference/dir_ls.html","id":null,"dir":"Reference","previous_headings":"","what":"List files — dir_ls","title":"List files — dir_ls","text":"dir_ls() equivalent ls command. returns filenames named fs_path character vector. names equivalent values, useful passing onto functions like purrr::map_dfr(). dir_info() equivalent ls -l shortcut file_info(dir_ls()). dir_map() applies function fun() entry path returns result list. dir_walk() calls fun side-effect returns input path.","code":""},{"path":"https://fs.r-lib.org/dev/reference/dir_ls.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"List files — dir_ls","text":"","code":"dir_ls( path = \".\", all = FALSE, recurse = FALSE, type = \"any\", glob = NULL, regexp = NULL, invert = FALSE, fail = TRUE, ..., recursive ) dir_map( path = \".\", fun, all = FALSE, recurse = FALSE, type = \"any\", fail = TRUE ) dir_walk( path = \".\", fun, all = FALSE, recurse = FALSE, type = \"any\", fail = TRUE ) dir_info( path = \".\", all = FALSE, recurse = FALSE, type = \"any\", regexp = NULL, glob = NULL, fail = TRUE, ... )"},{"path":"https://fs.r-lib.org/dev/reference/dir_ls.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"List files — dir_ls","text":"path character vector one paths. TRUE hidden files also returned. recurse TRUE recurse fully, positive number number levels recurse. type File type(s) return, one \"\", \"file\", \"directory\", \"symlink\", \"FIFO\", \"socket\", \"character_device\" \"block_device\". glob wildcard aka globbing pattern (e.g. *.csv) passed grep() filter paths. regexp regular expression (e.g. [.]csv$) passed grep() filter paths. invert TRUE return files match fail call fail (default) warn file accessed. ... Additional arguments passed grep. recursive (Deprecated) TRUE recurse fully. fun function, taking one parameter, current path entry.","code":""},{"path":"https://fs.r-lib.org/dev/reference/dir_ls.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"List files — dir_ls","text":"","code":"dir_ls(R.home(\"share\"), type = \"directory\") #> /opt/R/4.4.1/lib/R/share/R #> /opt/R/4.4.1/lib/R/share/Rd #> /opt/R/4.4.1/lib/R/share/dictionaries #> /opt/R/4.4.1/lib/R/share/encodings #> /opt/R/4.4.1/lib/R/share/java #> /opt/R/4.4.1/lib/R/share/licenses #> /opt/R/4.4.1/lib/R/share/make #> /opt/R/4.4.1/lib/R/share/sh #> /opt/R/4.4.1/lib/R/share/texmf # Create a shorter link link_create(system.file(package = \"base\"), \"base\") dir_ls(\"base\", recurse = TRUE, glob = \"*.R\") #> base/demo/error.catching.R base/demo/is.things.R #> base/demo/recursion.R base/demo/scoping.R # If you need the full paths input an absolute path dir_ls(path_abs(\"base\")) #> /tmp/RtmpDSF2Zg/base/CITATION /tmp/RtmpDSF2Zg/base/DESCRIPTION #> /tmp/RtmpDSF2Zg/base/INDEX /tmp/RtmpDSF2Zg/base/Meta #> /tmp/RtmpDSF2Zg/base/R /tmp/RtmpDSF2Zg/base/demo #> /tmp/RtmpDSF2Zg/base/help /tmp/RtmpDSF2Zg/base/html dir_map(\"base\", identity) #> [[1]] #> [1] \"base/CITATION\" #> #> [[2]] #> [1] \"base/DESCRIPTION\" #> #> [[3]] #> [1] \"base/INDEX\" #> #> [[4]] #> [1] \"base/Meta\" #> #> [[5]] #> [1] \"base/R\" #> #> [[6]] #> [1] \"base/demo\" #> #> [[7]] #> [1] \"base/help\" #> #> [[8]] #> [1] \"base/html\" #> dir_walk(\"base\", str) #> chr \"base/CITATION\" #> chr \"base/DESCRIPTION\" #> chr \"base/INDEX\" #> chr \"base/Meta\" #> chr \"base/R\" #> chr \"base/demo\" #> chr \"base/help\" #> chr \"base/html\" dir_info(\"base\") #> # A tibble: 8 × 18 #> path type size permissions modification_time user group #> #> 1 base/CITATION file 643 rw-r--r-- 2024-08-22 01:58:33 root root #> 2 …se/DESCRIPTION file 383 rw-r--r-- 2024-08-22 01:58:33 root root #> 3 base/INDEX file 24.2K rw-r--r-- 2024-08-22 01:58:33 root root #> 4 base/Meta dire… 4K rwxr-xr-x 2024-10-25 22:25:12 root root #> 5 base/R dire… 4K rwxr-xr-x 2024-10-25 22:25:12 root root #> 6 base/demo dire… 4K rwxr-xr-x 2024-10-25 22:25:12 root root #> 7 base/help dire… 4K rwxr-xr-x 2024-10-25 22:25:12 root root #> 8 base/html dire… 4K rwxr-xr-x 2024-10-25 22:25:12 root root #> # ℹ 11 more variables: device_id , hard_links , #> # special_device_id , inode , block_size , blocks , #> # flags , generation , access_time , #> # change_time , birth_time # Cleanup link_delete(\"base\")"},{"path":"https://fs.r-lib.org/dev/reference/dir_tree.html","id":null,"dir":"Reference","previous_headings":"","what":"Print contents of directories in a tree-like format — dir_tree","title":"Print contents of directories in a tree-like format — dir_tree","text":"Print contents directories tree-like format","code":""},{"path":"https://fs.r-lib.org/dev/reference/dir_tree.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Print contents of directories in a tree-like format — dir_tree","text":"","code":"dir_tree(path = \".\", recurse = TRUE, ...)"},{"path":"https://fs.r-lib.org/dev/reference/dir_tree.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Print contents of directories in a tree-like format — dir_tree","text":"path path print tree recurse TRUE recurse fully, positive number number levels recurse. ... Arguments passed dir_ls type File type(s) return, one \"\", \"file\", \"directory\", \"symlink\", \"FIFO\", \"socket\", \"character_device\" \"block_device\". recursive (Deprecated) TRUE recurse fully. TRUE hidden files also returned. fail call fail (default) warn file accessed. glob wildcard aka globbing pattern (e.g. *.csv) passed grep() filter paths. regexp regular expression (e.g. [.]csv$) passed grep() filter paths. invert TRUE return files match","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_access.html","id":null,"dir":"Reference","previous_headings":"","what":"Query for existence and access permissions — file_access","title":"Query for existence and access permissions — file_access","text":"file_exists(path) shortcut file_access(x, \"exists\"); dir_exists(path) link_exists(path) similar also check path directory link, respectively. (file_exists(path) returns TRUE path exists directory.)","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_access.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Query for existence and access permissions — file_access","text":"","code":"file_access(path, mode = \"exists\") file_exists(path) dir_exists(path) link_exists(path)"},{"path":"https://fs.r-lib.org/dev/reference/file_access.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Query for existence and access permissions — file_access","text":"path character vector one paths. mode character vector containing one 'exists', 'read', 'write', 'execute'.","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_access.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Query for existence and access permissions — file_access","text":"logical vector, names corresponding input path.","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_access.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Query for existence and access permissions — file_access","text":"Cross-compatibility warning: executable bit Windows. Checking file mode 'execute' Windows, e.g. file_access(x, \"execute\") always return TRUE.","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_access.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Query for existence and access permissions — file_access","text":"","code":"file_access(\"/\") #> / #> TRUE file_access(\"/\", \"read\") #> / #> TRUE file_access(\"/\", \"write\") #> / #> FALSE file_exists(\"WOMBATS\") #> WOMBATS #> FALSE"},{"path":"https://fs.r-lib.org/dev/reference/file_chmod.html","id":null,"dir":"Reference","previous_headings":"","what":"Change file permissions — file_chmod","title":"Change file permissions — file_chmod","text":"Change file permissions","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_chmod.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Change file permissions — file_chmod","text":"","code":"file_chmod(path, mode)"},{"path":"https://fs.r-lib.org/dev/reference/file_chmod.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Change file permissions — file_chmod","text":"path character vector one paths. mode character representation mode, either hexidecimal symbolic format.","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_chmod.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Change file permissions — file_chmod","text":"Cross-compatibility warning: File permissions differ Windows POSIX systems. Windows use executable bit, attempting change effect. Windows also user groups, user permissions (u) relevant.","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_chmod.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Change file permissions — file_chmod","text":"","code":"file_create(\"foo\", mode = \"000\") file_chmod(\"foo\", \"777\") file_info(\"foo\")$permissions #> [1] rwxrwxrwx file_chmod(\"foo\", \"u-x\") file_info(\"foo\")$permissions #> [1] rw-rwxrwx file_chmod(\"foo\", \"a-wrx\") file_info(\"foo\")$permissions #> [1] --------- file_chmod(\"foo\", \"u+wr\") file_info(\"foo\")$permissions #> [1] rw------- # It is also vectorized files <- c(\"foo\", file_create(\"bar\", mode = \"000\")) file_chmod(files, \"a+rwx\") file_info(files)$permissions #> [1] rwxrwxrwx rwxrwxrwx file_chmod(files, c(\"644\", \"600\")) file_info(files)$permissions #> [1] rw-r--r-- rw-------"},{"path":"https://fs.r-lib.org/dev/reference/file_chown.html","id":null,"dir":"Reference","previous_headings":"","what":"Change owner or group of a file — file_chown","title":"Change owner or group of a file — file_chown","text":"Change owner group file","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_chown.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Change owner or group of a file — file_chown","text":"","code":"file_chown(path, user_id = NULL, group_id = NULL)"},{"path":"https://fs.r-lib.org/dev/reference/file_chown.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Change owner or group of a file — file_chown","text":"path character vector one paths. user_id user id new owner, specified numeric ID name. R process must privileged change . group_id group id new owner, specified numeric ID name.","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_info.html","id":null,"dir":"Reference","previous_headings":"","what":"Query file metadata — file_info","title":"Query file metadata — file_info","text":"Compared file.info() full results stat(2) system call returned columns returned S3 classes make manipulation natural. systems support metadata (Windows) default values used.","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_info.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Query file metadata — file_info","text":"","code":"file_info(path, fail = TRUE, follow = FALSE) file_size(path, fail = TRUE)"},{"path":"https://fs.r-lib.org/dev/reference/file_info.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Query file metadata — file_info","text":"path character vector one paths. fail call fail (default) warn file accessed. follow TRUE, symbolic links followed (recursively) results final file rather link.","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_info.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Query file metadata — file_info","text":"data.frame metadata file. Columns returned follows. path input path, fs_path() character vector. type file type, factor file types. size file size, fs_bytes() numeric vector. permissions file permissions, fs_perms() integer vector. modification_time time last data modification, POSIXct datetime. user file owner name - character vector. group file group name - character vector. device_id file device id - numeric vector. hard_links number hard links file - numeric vector. special_device_id special device id file - numeric vector. inode inode file - numeric vector. block_size optimal block file - numeric vector. blocks number blocks allocated file - numeric vector. flags user defined flags file - integer vector. generation generation number file - numeric vector. access_time time last access - POSIXct datetime. change_time time last file status change - POSIXct datetime. birth_time time inode created - POSIXct datetime.","code":""},{"path":[]},{"path":"https://fs.r-lib.org/dev/reference/file_info.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Query file metadata — file_info","text":"","code":"write.csv(mtcars, \"mtcars.csv\") file_info(\"mtcars.csv\") #> # A tibble: 1 × 18 #> path type size permissions modification_time user group #> #> 1 mtcars.csv file 1.74K rw-r--r-- 2024-10-25 22:26:12 runn… dock… #> # ℹ 11 more variables: device_id , hard_links , #> # special_device_id , inode , block_size , blocks , #> # flags , generation , access_time , #> # change_time , birth_time # Files in the working directory modified more than 20 days ago files <- file_info(dir_ls()) files$path[difftime(Sys.time(), files$modification_time, units = \"days\") > 20] #> character(0) # Cleanup file_delete(\"mtcars.csv\")"},{"path":"https://fs.r-lib.org/dev/reference/file_move.html","id":null,"dir":"Reference","previous_headings":"","what":"Move or rename files — file_move","title":"Move or rename files — file_move","text":"Compared file.rename file_move() always fails unable move file, rather signaling Warning returning error code.","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_move.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Move or rename files — file_move","text":"","code":"file_move(path, new_path)"},{"path":"https://fs.r-lib.org/dev/reference/file_move.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Move or rename files — file_move","text":"path character vector one paths. new_path New file path. new_path existing directory, file moved directory; otherwise moved/renamed full path. either length path, single directory.","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_move.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Move or rename files — file_move","text":"new path (invisibly).","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_move.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Move or rename files — file_move","text":"","code":"file_create(\"foo\") file_move(\"foo\", \"bar\") file_exists(c(\"foo\", \"bar\")) #> foo bar #> FALSE TRUE file_delete(\"bar\")"},{"path":"https://fs.r-lib.org/dev/reference/file_show.html","id":null,"dir":"Reference","previous_headings":"","what":"Open files or directories — file_show","title":"Open files or directories — file_show","text":"Open files directories","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_show.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Open files or directories — file_show","text":"","code":"file_show(path = \".\", browser = getOption(\"browser\"))"},{"path":"https://fs.r-lib.org/dev/reference/file_show.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Open files or directories — file_show","text":"path character vector one paths. browser non-empty character string giving name program used HTML browser. PATH, full path specified. Alternatively, R function called invoke browser. Windows NULL also allowed (default), implies file association mechanism used.","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_show.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Open files or directories — file_show","text":"directories opened (invisibly).","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_temp.html","id":null,"dir":"Reference","previous_headings":"","what":"Create names for temporary files — file_temp","title":"Create names for temporary files — file_temp","text":"file_temp() returns name can used temporary file.","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_temp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create names for temporary files — file_temp","text":"","code":"file_temp(pattern = \"file\", tmp_dir = tempdir(), ext = \"\") file_temp_push(path) file_temp_pop() path_temp(...)"},{"path":"https://fs.r-lib.org/dev/reference/file_temp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create names for temporary files — file_temp","text":"pattern character vector non-random portion name. tmp_dir directory file created . ext file extension temporary file. path character vector one paths. ... Additional paths appended temporary directory path().","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_temp.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create names for temporary files — file_temp","text":"file_temp_push() can used supply deterministic entries temporary file stack. can useful reproducibility like example documentation vignettes. file_temp_pop() can used explicitly remove entry internal stack, however generally done instead calling file_temp(). path_temp() constructs path within session temporary directory.","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_temp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create names for temporary files — file_temp","text":"","code":"path_temp() #> /tmp/RtmpDSF2Zg path_temp(\"does-not-exist\") #> /tmp/RtmpDSF2Zg/does-not-exist file_temp() #> /tmp/filedd461c46df20 file_temp(ext = \"png\") #> /tmp/RtmpDSF2Zg/file26554a766ee6.png file_temp(\"image\", ext = \"png\") #> /tmp/RtmpDSF2Zg/image265549d8da87.png # You can make the temp file paths deterministic file_temp_push(letters) file_temp() #> a file_temp() #> b # Or explicitly remove values while (!is.null(file_temp_pop())) next file_temp_pop() #> NULL"},{"path":"https://fs.r-lib.org/dev/reference/file_touch.html","id":null,"dir":"Reference","previous_headings":"","what":"Change file access and modification times — file_touch","title":"Change file access and modification times — file_touch","text":"Unlike touch POSIX utility create file exist. Use file_create() needed.","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_touch.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Change file access and modification times — file_touch","text":"","code":"file_touch(path, access_time = Sys.time(), modification_time = access_time)"},{"path":"https://fs.r-lib.org/dev/reference/file_touch.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Change file access and modification times — file_touch","text":"path character vector one paths. access_time, modification_time times set, inputs coerced POSIXct objects.","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_touch.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Change file access and modification times — file_touch","text":"","code":"file_create(\"foo\") file_touch(\"foo\", \"2018-01-01\") file_info(\"foo\")[c(\"access_time\", \"modification_time\", \"change_time\", \"birth_time\")] #> # A tibble: 1 × 4 #> access_time modification_time change_time #> #> 1 2018-01-01 00:00:00 2018-01-01 00:00:00 2024-10-25 22:26:12 #> # ℹ 1 more variable: birth_time "},{"path":"https://fs.r-lib.org/dev/reference/fs-package.html","id":null,"dir":"Reference","previous_headings":"","what":"fs: Cross-Platform File System Operations Based on 'libuv' — fs-package","title":"fs: Cross-Platform File System Operations Based on 'libuv' — fs-package","text":"cross-platform interface file system operations, built top 'libuv' C library.","code":""},{"path":[]},{"path":"https://fs.r-lib.org/dev/reference/fs-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"fs: Cross-Platform File System Operations Based on 'libuv' — fs-package","text":"Maintainer: Gábor Csárdi csardi.gabor@gmail.com Authors: Jim Hester Hadley Wickham hadley@posit.co contributors: libuv project contributors (libuv library) [copyright holder] Joyent, Inc. Node contributors (libuv library) [copyright holder] Posit Software, PBC [copyright holder, funder]","code":""},{"path":"https://fs.r-lib.org/dev/reference/fs_bytes.html","id":null,"dir":"Reference","previous_headings":"","what":"Human readable file sizes — fs_bytes","title":"Human readable file sizes — fs_bytes","text":"Construct, manipulate display vectors file sizes. numeric vectors, can compare numerically, can also compared human readable values '10MB'.","code":""},{"path":"https://fs.r-lib.org/dev/reference/fs_bytes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Human readable file sizes — fs_bytes","text":"","code":"as_fs_bytes(x) fs_bytes(x)"},{"path":"https://fs.r-lib.org/dev/reference/fs_bytes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Human readable file sizes — fs_bytes","text":"x numeric character vector. Character representations can use shorthand sizes (see examples).","code":""},{"path":"https://fs.r-lib.org/dev/reference/fs_bytes.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Human readable file sizes — fs_bytes","text":"","code":"fs_bytes(\"1\") #> 1 fs_bytes(\"1K\") #> 1K fs_bytes(\"1Kb\") #> 1K fs_bytes(\"1Kib\") #> 1K fs_bytes(\"1MB\") #> 1M fs_bytes(\"1KB\") < \"1MB\" #> [1] TRUE sum(fs_bytes(c(\"1MB\", \"5MB\", \"500KB\"))) #> 6.49M"},{"path":"https://fs.r-lib.org/dev/reference/fs_path.html","id":null,"dir":"Reference","previous_headings":"","what":"File paths — fs_path","title":"File paths — fs_path","text":"Tidy file paths, character vectors coloured file type capable terminals. Colouring can customized setting LS_COLORS environment variable, format read GNU ls / dircolors. Colouring file paths can disabled setting LS_COLORS empty string e.g. Sys.setenv(LS_COLORS = \"\").","code":""},{"path":"https://fs.r-lib.org/dev/reference/fs_path.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"File paths — fs_path","text":"","code":"as_fs_path(x) fs_path(x)"},{"path":"https://fs.r-lib.org/dev/reference/fs_path.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"File paths — fs_path","text":"x vector coerced fs_path object.","code":""},{"path":[]},{"path":"https://fs.r-lib.org/dev/reference/fs_perms.html","id":null,"dir":"Reference","previous_headings":"","what":"Create, modify and view file permissions — fs_perms","title":"Create, modify and view file permissions — fs_perms","text":"fs_perms() objects help one create modify file permissions easily. support numeric input, octal symbolic character representations. Compared octmode support symbolic representations display mode format ls POSIX systems.","code":""},{"path":"https://fs.r-lib.org/dev/reference/fs_perms.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create, modify and view file permissions — fs_perms","text":"","code":"as_fs_perms(x, ...) fs_perms(x, ...)"},{"path":"https://fs.r-lib.org/dev/reference/fs_perms.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create, modify and view file permissions — fs_perms","text":"x object coerced fs_perms object. Can number octal character representation, including symbolic representations. ... Additional arguments passed methods.","code":""},{"path":"https://fs.r-lib.org/dev/reference/fs_perms.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create, modify and view file permissions — fs_perms","text":"POSIX systems permissions displayed 9 character string three sets three characters. set corresponds permissions user, group (default) users. first character set \"r\", file readable users, \"-\", readable. second character set \"w\", file writable users, \"-\", writable. third character complex, first following characters apply. 'S' character part owner permissions file executable directory searchable owner, set-user-id bit set. 'S' character part group permissions file executable directory searchable group, set-group-id bit set. 'T' character part permissions file executable directory searchable others, 'sticky' (S_ISVTX) bit set. 's' character part owner permissions file executable directory searchable owner, set-user-id bit set. 's' character part group permissions file executable directory searchable group, set-group-id bit set. 't' character part permissions file executable directory searchable others, ”sticky” (S_ISVTX) bit set. 'x' file executable directory searchable. '-' none apply. commonly third character either 'x' -. Windows permissions displayed 3 character string third character - x.","code":""},{"path":"https://fs.r-lib.org/dev/reference/fs_perms.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create, modify and view file permissions — fs_perms","text":"","code":"# Integer and numeric fs_perms(420L) #> [1] rw-r--r-- fs_perms(c(511, 420)) #> [1] rwxrwxrwx rw-r--r-- # Octal fs_perms(\"777\") #> [1] rwxrwxrwx fs_perms(c(\"777\", \"644\")) #> [1] rwxrwxrwx rw-r--r-- # Symbolic fs_perms(\"a+rwx\") #> [1] rwxrwxrwx fs_perms(c(\"a+rwx\", \"u+rw,go+r\")) #> [1] rwxrwxrwx rw-r--r-- # Use the `&` and `|`operators to check for certain permissions (fs_perms(\"777\") & \"u+r\") == \"u+r\" #> [1] TRUE"},{"path":"https://fs.r-lib.org/dev/reference/id.html","id":null,"dir":"Reference","previous_headings":"","what":"Lookup Users and Groups on a system — id","title":"Lookup Users and Groups on a system — id","text":"functions use GETPWENT(3) GETGRENT(3) system calls query users groups respectively.","code":""},{"path":"https://fs.r-lib.org/dev/reference/id.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Lookup Users and Groups on a system — id","text":"","code":"group_ids() user_ids()"},{"path":"https://fs.r-lib.org/dev/reference/id.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Lookup Users and Groups on a system — id","text":"return results data.frame. windows functions return empty data.frame windows user group ids.","code":""},{"path":"https://fs.r-lib.org/dev/reference/id.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Lookup Users and Groups on a system — id","text":"","code":"# list first 6 groups head(group_ids()) #> group_id group_name #> 1 0 root #> 2 1 daemon #> 3 2 bin #> 4 3 sys #> 5 4 adm #> 6 5 tty # list first 6 users head(user_ids()) #> user_id user_name #> 1 0 root #> 2 1 daemon #> 3 2 bin #> 4 3 sys #> 5 4 sync #> 6 5 games"},{"path":"https://fs.r-lib.org/dev/reference/is_absolute_path.html","id":null,"dir":"Reference","previous_headings":"","what":"Test if a path is an absolute path — is_absolute_path","title":"Test if a path is an absolute path — is_absolute_path","text":"Test path absolute path","code":""},{"path":"https://fs.r-lib.org/dev/reference/is_absolute_path.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Test if a path is an absolute path — is_absolute_path","text":"","code":"is_absolute_path(path)"},{"path":"https://fs.r-lib.org/dev/reference/is_absolute_path.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Test if a path is an absolute path — is_absolute_path","text":"path character vector one paths.","code":""},{"path":"https://fs.r-lib.org/dev/reference/is_absolute_path.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Test if a path is an absolute path — is_absolute_path","text":"","code":"is_absolute_path(\"/foo\") #> [1] TRUE is_absolute_path(\"C:\\\\foo\") #> [1] TRUE is_absolute_path(\"\\\\\\\\myserver\\\\foo\\\\bar\") #> [1] TRUE is_absolute_path(\"foo/bar\") #> [1] FALSE"},{"path":"https://fs.r-lib.org/dev/reference/is_file.html","id":null,"dir":"Reference","previous_headings":"","what":"Functions to test for file types — is_file","title":"Functions to test for file types — is_file","text":"Functions test file types","code":""},{"path":"https://fs.r-lib.org/dev/reference/is_file.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Functions to test for file types — is_file","text":"","code":"is_file(path, follow = TRUE) is_dir(path, follow = TRUE) is_link(path) is_file_empty(path, follow = TRUE)"},{"path":"https://fs.r-lib.org/dev/reference/is_file.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Functions to test for file types — is_file","text":"path character vector one paths. follow TRUE, symbolic links followed (recursively) results final file rather link.","code":""},{"path":"https://fs.r-lib.org/dev/reference/is_file.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Functions to test for file types — is_file","text":"named logical vector, names give paths. given object exist, NA returned.","code":""},{"path":[]},{"path":"https://fs.r-lib.org/dev/reference/is_file.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Functions to test for file types — is_file","text":"","code":"dir_create(\"d\") file_create(\"d/file.txt\") dir_create(\"d/dir\") link_create(path(path_abs(\"d\"), \"file.txt\"), \"d/link\") paths <- dir_ls(\"d\") is_file(paths) #> d/dir d/file.txt d/link #> FALSE TRUE TRUE is_dir(paths) #> d/dir d/file.txt d/link #> TRUE FALSE FALSE is_link(paths) #> d/dir d/file.txt d/link #> FALSE FALSE TRUE # Cleanup dir_delete(\"d\")"},{"path":"https://fs.r-lib.org/dev/reference/link_path.html","id":null,"dir":"Reference","previous_headings":"","what":"Read the value of a symbolic link — link_path","title":"Read the value of a symbolic link — link_path","text":"Read value symbolic link","code":""},{"path":"https://fs.r-lib.org/dev/reference/link_path.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read the value of a symbolic link — link_path","text":"","code":"link_path(path)"},{"path":"https://fs.r-lib.org/dev/reference/link_path.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read the value of a symbolic link — link_path","text":"path character vector one paths.","code":""},{"path":"https://fs.r-lib.org/dev/reference/link_path.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read the value of a symbolic link — link_path","text":"tidy path object link points .","code":""},{"path":"https://fs.r-lib.org/dev/reference/link_path.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read the value of a symbolic link — link_path","text":"","code":"file_create(\"foo\") link_create(path_abs(\"foo\"), \"bar\") link_path(\"bar\") #> /tmp/RtmpDSF2Zg/foo # Cleanup file_delete(c(\"foo\", \"bar\"))"},{"path":"https://fs.r-lib.org/dev/reference/path.html","id":null,"dir":"Reference","previous_headings":"","what":"Construct path to a file or directory — path","title":"Construct path to a file or directory — path","text":"path() constructs relative path, path_wd() constructs absolute path current working directory.","code":""},{"path":"https://fs.r-lib.org/dev/reference/path.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Construct path to a file or directory — path","text":"","code":"path(..., ext = \"\") path_wd(..., ext = \"\")"},{"path":"https://fs.r-lib.org/dev/reference/path.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Construct path to a file or directory — path","text":"... character vectors, values NA, result also NA. paths follow recycling rules used tibble package, namely length 1 arguments recycled. ext optional extension append generated path.","code":""},{"path":[]},{"path":"https://fs.r-lib.org/dev/reference/path.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Construct path to a file or directory — path","text":"","code":"path(\"foo\", \"bar\", \"baz\", ext = \"zip\") #> foo/bar/baz.zip path(\"foo\", letters[1:3], ext = \"txt\") #> foo/a.txt foo/b.txt foo/c.txt"},{"path":"https://fs.r-lib.org/dev/reference/path_expand.html","id":null,"dir":"Reference","previous_headings":"","what":"Finding the User Home Directory — path_expand","title":"Finding the User Home Directory — path_expand","text":"path_expand() performs tilde expansion path, replacing instances ~ ~user user's home directory. path_home() constructs path within expanded users home directory, calling arguments can useful verify fs considers home directory. path_expand_r() path_home_r() equivalents always use R's definition home directory.","code":""},{"path":"https://fs.r-lib.org/dev/reference/path_expand.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Finding the User Home Directory — path_expand","text":"","code":"path_expand(path) path_expand_r(path) path_home(...) path_home_r(...)"},{"path":"https://fs.r-lib.org/dev/reference/path_expand.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Finding the User Home Directory — path_expand","text":"path character vector one paths. ... Additional paths appended home directory path().","code":""},{"path":"https://fs.r-lib.org/dev/reference/path_expand.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Finding the User Home Directory — path_expand","text":"path_expand() differs base::path.expand() interpretation home directory Windows. particular path_expand() uses path set USERPROFILE environment variable , unset, uses HOMEDRIVE/HOMEPATH. contrast base::path.expand() first checks R_USER HOME, default configuration R Windows set user's document directory, e.g. C:\\\\Users\\\\username\\\\Documents. base::path.expand() also support ~otheruser syntax Windows, whereas path_expand() support syntax systems. definition makes fs consistent definition home directory used Windows languages, python rust. also compatible external tools git ssh, put user-level files USERPROFILE default. also allows write portable paths, ~/Desktop points Desktop location Windows, macOS () Linux systems. Users can set R_FS_HOME environment variable override definitions platform.","code":""},{"path":[]},{"path":"https://fs.r-lib.org/dev/reference/path_expand.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Finding the User Home Directory — path_expand","text":"","code":"# Expand a path path_expand(\"~/bin\") #> /home/runner/bin # You can use `path_home()` without arguments to see what is being used as # the home diretory. path_home() #> /home/runner path_home(\"R\") #> /home/runner/R # This will likely differ from the above on Windows path_home_r() #> /home/runner"},{"path":"https://fs.r-lib.org/dev/reference/path_file.html","id":null,"dir":"Reference","previous_headings":"","what":"Manipulate file paths — path_file","title":"Manipulate file paths — path_file","text":"path_file() returns filename portion path, path_dir() returns directory portion. path_ext() returns last extension () path. path_ext_remove() removes last extension returns rest path. path_ext_set() replaces extension new extension. existing extension new extension appended.","code":""},{"path":"https://fs.r-lib.org/dev/reference/path_file.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Manipulate file paths — path_file","text":"","code":"path_file(path) path_dir(path) path_ext(path) path_ext_remove(path) path_ext_set(path, ext) path_ext(path) <- value"},{"path":"https://fs.r-lib.org/dev/reference/path_file.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Manipulate file paths — path_file","text":"path character vector one paths. ext, value new file extension.","code":""},{"path":"https://fs.r-lib.org/dev/reference/path_file.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Manipulate file paths — path_file","text":"Note full file paths return regular character vectors, fs_path() objects.","code":""},{"path":[]},{"path":"https://fs.r-lib.org/dev/reference/path_file.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Manipulate file paths — path_file","text":"","code":"path_file(\"dir/file.zip\") #> [1] \"file.zip\" path_dir(\"dir/file.zip\") #> [1] \"dir\" path_ext(\"dir/file.zip\") #> [1] \"zip\" path_ext(\"file.tar.gz\") #> [1] \"gz\" path_ext_remove(\"file.tar.gz\") #> [1] \"file.tar\" # Only one level of extension is removed path_ext_set(path_ext_remove(\"file.tar.gz\"), \"zip\") #> file.zip"},{"path":"https://fs.r-lib.org/dev/reference/path_filter.html","id":null,"dir":"Reference","previous_headings":"","what":"Filter paths — path_filter","title":"Filter paths — path_filter","text":"Filter paths","code":""},{"path":"https://fs.r-lib.org/dev/reference/path_filter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Filter paths — path_filter","text":"","code":"path_filter(path, glob = NULL, regexp = NULL, invert = FALSE, ...)"},{"path":"https://fs.r-lib.org/dev/reference/path_filter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Filter paths — path_filter","text":"path character vector one paths. glob wildcard aka globbing pattern (e.g. *.csv) passed grep() filter paths. regexp regular expression (e.g. [.]csv$) passed grep() filter paths. invert TRUE return files match ... Additional arguments passed grep.","code":""},{"path":"https://fs.r-lib.org/dev/reference/path_filter.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Filter paths — path_filter","text":"","code":"path_filter(c(\"foo\", \"boo\", \"bar\"), glob = \"*oo\") #> foo boo path_filter(c(\"foo\", \"boo\", \"bar\"), glob = \"*oo\", invert = TRUE) #> bar path_filter(c(\"foo\", \"boo\", \"bar\"), regexp = \"b.r\") #> bar"},{"path":"https://fs.r-lib.org/dev/reference/path_math.html","id":null,"dir":"Reference","previous_headings":"","what":"Path computations — path_math","title":"Path computations — path_math","text":"functions apart path_real() purely path computations, files question need exist filesystem.","code":""},{"path":"https://fs.r-lib.org/dev/reference/path_math.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Path computations — path_math","text":"","code":"path_real(path) path_split(path) path_join(parts) path_abs(path, start = \".\") path_norm(path) path_rel(path, start = \".\") path_common(path) path_has_parent(path, parent)"},{"path":"https://fs.r-lib.org/dev/reference/path_math.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Path computations — path_math","text":"path character vector one paths. parts character vector list character vectors, corresponding split paths. start starting directory compute path relative . parent parent path.","code":""},{"path":"https://fs.r-lib.org/dev/reference/path_math.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Path computations — path_math","text":"new path(s) fs_path object, character vector also class fs_path. Except path_split(), returns list character vectors path components.","code":""},{"path":"https://fs.r-lib.org/dev/reference/path_math.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Path computations — path_math","text":"path_real(): returns canonical path, eliminating symbolic links special references ~, ~user, ., .., , .e. calls path_expand() (literally) path_norm() (effectively). path_split(): splits paths parts. path_join(): joins parts together. inverse path_split(). See path() concatenate vectorized strings path. path_abs(): returns normalized, absolute version path. path_norm(): eliminates . references rationalizes -level .. references, /./B /foo/../B become /B, ../B changed. one paths symbolic link, may change meaning path, consider using path_real() instead. path_rel(): computes path relative start path, can either absolute relative path. path_common(): finds common parts two () paths. path_has_parent(): determine path given parent.","code":""},{"path":[]},{"path":"https://fs.r-lib.org/dev/reference/path_math.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Path computations — path_math","text":"","code":"dir_create(\"a\") file_create(\"a/b\") link_create(path_abs(\"a\"), \"c\") # Realize the path path_real(\"c/b\") #> /tmp/RtmpDSF2Zg/a/b # Split a path parts <- path_split(\"a/b\") parts #> [[1]] #> [1] \"a\" \"b\" #> # Join it together path_join(parts) #> a/b # Find the absolute path path_abs(\"..\") #> /tmp # Normalize a path path_norm(\"a/../b\\\\c/.\") #> b/c # Compute a relative path path_rel(\"/foo/abc\", \"/foo/bar/baz\") #> ../../abc # Find the common path between multiple paths path_common(c(\"/foo/bar/baz\", \"/foo/bar/abc\", \"/foo/xyz/123\")) #> /foo # Cleanup dir_delete(\"a\") link_delete(\"c\")"},{"path":"https://fs.r-lib.org/dev/reference/path_package.html","id":null,"dir":"Reference","previous_headings":"","what":"Construct a path to a location within an installed or development package — path_package","title":"Construct a path to a location within an installed or development package — path_package","text":"path_package differs system.file() always returns error package exist. also returns different error file within package exist.","code":""},{"path":"https://fs.r-lib.org/dev/reference/path_package.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Construct a path to a location within an installed or development package — path_package","text":"","code":"path_package(package, ...)"},{"path":"https://fs.r-lib.org/dev/reference/path_package.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Construct a path to a location within an installed or development package — path_package","text":"package Name package search ... Additional paths appended package path path().","code":""},{"path":"https://fs.r-lib.org/dev/reference/path_package.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Construct a path to a location within an installed or development package — path_package","text":"path_package() also automatically works packages loaded devtools even path_package() call comes different package.","code":""},{"path":"https://fs.r-lib.org/dev/reference/path_package.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Construct a path to a location within an installed or development package — path_package","text":"","code":"path_package(\"base\") #> /opt/R/4.4.1/lib/R/library/base path_package(\"stats\") #> /opt/R/4.4.1/lib/R/library/stats path_package(\"base\", \"INDEX\") #> /opt/R/4.4.1/lib/R/library/base/INDEX path_package(\"splines\", \"help\", \"AnIndex\") #> /opt/R/4.4.1/lib/R/library/splines/help/AnIndex"},{"path":"https://fs.r-lib.org/dev/reference/path_sanitize.html","id":null,"dir":"Reference","previous_headings":"","what":"Sanitize a filename by removing directory paths and invalid characters — path_sanitize","title":"Sanitize a filename by removing directory paths and invalid characters — path_sanitize","text":"path_sanitize() removes following: Control characters Reserved characters Unix reserved filenames (. ..) Trailing periods spaces (invalid Windows) Windows reserved filenames (CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, LPT9) resulting string truncated 255 bytes length","code":""},{"path":"https://fs.r-lib.org/dev/reference/path_sanitize.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Sanitize a filename by removing directory paths and invalid characters — path_sanitize","text":"","code":"path_sanitize(filename, replacement = \"\")"},{"path":"https://fs.r-lib.org/dev/reference/path_sanitize.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Sanitize a filename by removing directory paths and invalid characters — path_sanitize","text":"filename character vector sanitized. replacement character vector used replace invalid characters.","code":""},{"path":[]},{"path":"https://fs.r-lib.org/dev/reference/path_sanitize.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Sanitize a filename by removing directory paths and invalid characters — path_sanitize","text":"","code":"# potentially unsafe string str <- \"~/.\\u0001ssh/authorized_keys\" path_sanitize(str) #> [1] \"~.sshauthorized_keys\" path_sanitize(\"..\") #> [1] \"\""},{"path":"https://fs.r-lib.org/dev/reference/path_tidy.html","id":null,"dir":"Reference","previous_headings":"","what":"Tidy paths — path_tidy","title":"Tidy paths — path_tidy","text":"untidy paths different, tidy paths . Tidy paths always use / delimit directories, never multiple / trailing / colourised output based file type.","code":""},{"path":"https://fs.r-lib.org/dev/reference/path_tidy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Tidy paths — path_tidy","text":"","code":"path_tidy(path)"},{"path":"https://fs.r-lib.org/dev/reference/path_tidy.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Tidy paths — path_tidy","text":"path character vector one paths.","code":""},{"path":"https://fs.r-lib.org/dev/reference/path_tidy.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Tidy paths — path_tidy","text":"fs_path object, character vector also class fs_path","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-development-version","dir":"Changelog","previous_headings":"","what":"fs (development version)","title":"fs (development version)","text":"path_ext() path_ext_remove() return correct extension path, respectively, multiple dots present file name (@IndrajeetPatil, #452, #453). path_rel() provides informative error message multiple starting directory paths specified (@IndrajeetPatil, #454).","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-164","dir":"Changelog","previous_headings":"","what":"fs 1.6.4","title":"fs 1.6.4","text":"CRAN release: 2024-04-25 changes.","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-163","dir":"Changelog","previous_headings":"","what":"fs 1.6.3","title":"fs 1.6.3","text":"CRAN release: 2023-07-20 user visible changes.","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-162","dir":"Changelog","previous_headings":"","what":"fs 1.6.2","title":"fs 1.6.2","text":"CRAN release: 2023-04-25 path_ext_set() can now handle extensions contain ., e.g. csv.gz (@mgirlich, #415).","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-161","dir":"Changelog","previous_headings":"","what":"fs 1.6.1","title":"fs 1.6.1","text":"CRAN release: 2023-02-06 user visible changes.","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-160","dir":"Changelog","previous_headings":"","what":"fs 1.6.0","title":"fs 1.6.0","text":"CRAN release: 2023-01-23 inputs path_real() path_join() coerced character consistency functions (@raymondben, #370) fs uses libuv 1.44.2 now.","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-152","dir":"Changelog","previous_headings":"","what":"fs 1.5.2","title":"fs 1.5.2","text":"CRAN release: 2021-12-08 file_create() dir_create() now return correct path ... arguments used (@davidchall, #333). dir_create(recurse = FALSE) now correctly handles ... arguments (@davidchall, #333). file_exists() now expands ~ (#325). dir_copy() works path length >1 (#360).","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-151","dir":"Changelog","previous_headings":"","what":"fs 1.5.1","title":"fs 1.5.1","text":"CRAN release: 2021-11-30 Gábor Csárdi now maintainer. fs now licensed MIT (#301). dir_create() now restores previous umask (#293) file_exists() now much faster (#295) options(fs.fs_path.shorten) can now used control paths shortened tibbles. default value “front”, valid alternatives “back”, “middle” “abbreviate”. (#335) options(fs.use_tibble = FALSE) can now used disable use tibbles (#295). path_tidy() now works non-UTF8 encoded paths (@shrektan, #321).","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-150","dir":"Changelog","previous_headings":"","what":"fs 1.5.0","title":"fs 1.5.0","text":"CRAN release: 2020-07-31 libuv release used fs updated 1.38.1 dir_create() now consults process umask mode directory creation works like mkdir (#284). fs_path, fs_bytes fs_perms objects now compatible vctrs 0.3.0 (#266) fs_path objects now sort properly mix ASCII unicode elements (#279)","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-142","dir":"Changelog","previous_headings":"","what":"fs 1.4.2","title":"fs 1.4.2","text":"CRAN release: 2020-06-30 file_info(..., follow = TRUE), is_dir(), is_file() follow relative symlinks non-current directories (@heavywatal, #280) dir_map() now grows internal list safely, 1.4.0 release introduced unsafe regression (#268) file_info() returns tibble tibble package installed, subsets work data.frame (#265) path_real() always fails file exist. Thus can longer used resolve symlinks path hierarchy files yet exist. reverts feature introduced 1.2.7 (#144, #221, #231)","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-141","dir":"Changelog","previous_headings":"","what":"fs 1.4.1","title":"fs 1.4.1","text":"CRAN release: 2020-04-03 Fix compilation Solaris.","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-140","dir":"Changelog","previous_headings":"","what":"fs 1.4.0","title":"fs 1.4.0","text":"CRAN release: 2020-03-31 [[.fs_path, [[.fs_bytes [[.fs_perms now preserve classes subsetting (#254). path_has_parent() now recycles path parent arguments (#253). path_ext_set() now recycles path ext arguments (#250). Internally fs longer depends Rcpp","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-132","dir":"Changelog","previous_headings":"","what":"fs 1.3.2","title":"fs 1.3.2","text":"CRAN release: 2020-03-05 fs now passes along CPPFLAGS compilation libuv, fixing issue prevent compilation source macOS Catalina. (@kevinushey, #229) fs now compiles alpine linux (#210) dir_create() now works absolute paths recurse = FALSE (#204). dir_tree() now works paths need tilde expansion (@dmurdoch, @jennybc, #203). file_info() now returns file sizes proper classes (“fs_bytes” “numeric”), rather just “fs_bytes” (#239) get_dirent_type() gains fail argument (@bellma-lilly, #219) is_dir(), is_file(), is_file_empty() file_info() gain follow argument, follow links return information linked file rather link (#198) path() now follows “tidy” recycling rules, namely consistent length 1 inputs recycled. (#238) path() now errors path given constructed exceed PATH_MAX (#233). path_ext_set() now works multiple paths (@maurolepore, #208).","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-131","dir":"Changelog","previous_headings":"","what":"fs 1.3.1","title":"fs 1.3.1","text":"CRAN release: 2019-05-06 Fix missed test UTF-8 characters, now passes strict Latin-1 locale. Fix undefined behavior casting -1 size_t.","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-130","dir":"Changelog","previous_headings":"","what":"fs 1.3.0","title":"fs 1.3.0","text":"CRAN release: 2019-05-02","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"breaking-changes-1-3-0","dir":"Changelog","previous_headings":"","what":"Breaking changes","title":"fs 1.3.0","text":"dir_ls(), dir_map(), dir_walk(), dir_info() dir_tree() gain recurse argument, can either TRUE FALSE (supported previously) number levels recurse. previous argument recursive deprecated.","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"new-features-1-3-0","dir":"Changelog","previous_headings":"","what":"New features","title":"fs 1.3.0","text":"dir_copy() gains overwrite argument, overwrite given directory (@pasipasi123, #193)","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"minor-improvements-and-fixes-1-3-0","dir":"Changelog","previous_headings":"","what":"Minor improvements and fixes","title":"fs 1.3.0","text":"dir_create() now throws accurate error message try create directory non-writeable location (#196). fs_path objects now always show 10 characters default printed tibbles (#191). path_file(), path_dir() path_ext() now return normal character vectors rather tidy paths (#194). path_package() now works paths development packages automatically (#175). tests now pass successfully run strict Latin-1 locale","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-127","dir":"Changelog","previous_headings":"","what":"fs 1.2.7","title":"fs 1.2.7","text":"CRAN release: 2019-03-19","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"new-features-1-2-7","dir":"Changelog","previous_headings":"","what":"New features","title":"fs 1.2.7","text":"file_size() function added helper file_info(\"file\")$size (#171) is_file_empty() function added test empty files` (#171) dir_tree() function added print command line representation directory tree, analogous unix tree program (#82). Add comparison vignette quickly compare base R, fs shell alternatives (@xvrdm, #168).","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"minor-improvements-and-fixes-1-2-7","dir":"Changelog","previous_headings":"","what":"Minor improvements and fixes","title":"fs 1.2.7","text":"path_ext_set() file_temp() now treat extensions leading . without equally. e.g. path_ext_set(\"foo\", ext = \"bar\") path_ext_set(\"foo\", ext = \".bar\") result “foo.bar” Tidy paths now always returned uppercase drive letters Windows (#174). format.bench_bytes() now works str() R 3.5.1+ (#155). path_ext(), path_ext_remove(), path_ext_set() now work paths extension, file_temp() now prepends . file extension (#153). Link -pthread default fix BSD systems (#128, #145, #146). file_chown() can now take group_id parameter character (@cderv, #162). Parameter browser file_show() now works described documentation (@GegznaV, #154). path_real() now works even file exist, symlinks path hierarchy (#144). colourise_fs_path() now returns paths uncolored colors argument / LS_COLORS malformed (#135).","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-126","dir":"Changelog","previous_headings":"","what":"fs 1.2.6","title":"fs 1.2.6","text":"CRAN release: 2018-08-23 small bugfix release. file_move() now fall back copying, removing files moving files devices (otherwise fail) (#131, https://github.com/r-lib/usethis/issues/438). Fix double free using warn = TRUE (#132)","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-125","dir":"Changelog","previous_headings":"","what":"fs 1.2.5","title":"fs 1.2.5","text":"CRAN release: 2018-07-30 Patch release fix tests left files R session directory","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-124","dir":"Changelog","previous_headings":"","what":"fs 1.2.4","title":"fs 1.2.4","text":"CRAN release: 2018-07-26","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"new-features-1-2-4","dir":"Changelog","previous_headings":"","what":"New Features","title":"fs 1.2.4","text":"New path_wd() generates paths current working directory (#122). New path_has_parent() determines path given parent (#116). New file_touch() used change access modification times file (#98). dir_ls(), dir_map(), dir_walk(), dir_info() file_info() gain fail parameter, signal warnings rather errors called path unavailable due permissions locked resources (#105).","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"minor-improvements-and-fixes-1-2-4","dir":"Changelog","previous_headings":"","what":"Minor improvements and fixes","title":"fs 1.2.4","text":"path_tidy() now always includes trailing slash windows root directory, e.g. C:/ (#124). path_ext(), path_ext_set() path_ext_remove() now handle paths non-ASCII characters (#120). fs_path objects now print (without colors) even user permission stat (#121). compatibility upcoming gcc 8 based Windows toolchain (#119)","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-123","dir":"Changelog","previous_headings":"","what":"fs 1.2.3","title":"fs 1.2.3","text":"CRAN release: 2018-06-08","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"features-1-2-3","dir":"Changelog","previous_headings":"","what":"Features","title":"fs 1.2.3","text":"Experimental support / + methods fs_path objects (#110). file_create() dir_create() now take ..., passed path() make construction little nicer (#80).","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"bugfixes-1-2-3","dir":"Changelog","previous_headings":"","what":"Bugfixes","title":"fs 1.2.3","text":"path_ext(), path_ext_set() path_ext_remove() now handle paths directories including hidden files without extensions (#92). file_copy() now copies files directory target directory (#102).","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-122","dir":"Changelog","previous_headings":"","what":"fs 1.2.2","title":"fs 1.2.2","text":"CRAN release: 2018-03-21","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"features-1-2-2","dir":"Changelog","previous_headings":"","what":"Features","title":"fs 1.2.2","text":"fs longer needs C++11 compiler, now works compilers support C++03 (#90).","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"bugfixes-1-2-2","dir":"Changelog","previous_headings":"","what":"Bugfixes","title":"fs 1.2.2","text":"fs_path fs_bytes fs_perm objects now use methods::setOldClass() S4 dispatch base classes works intended (#91). Fix allocation bug path_exists() using delete [] used free().","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-121","dir":"Changelog","previous_headings":"","what":"fs 1.2.1","title":"fs 1.2.1","text":"CRAN release: 2018-03-20","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"features-1-2-1","dir":"Changelog","previous_headings":"","what":"Features","title":"fs 1.2.1","text":"path_abs() gains start argument, specify absolute path calculated (#87).","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"bugfixes-1-2-1","dir":"Changelog","previous_headings":"","what":"Bugfixes","title":"fs 1.2.1","text":"path_ext() now returns character() given 0 length inputs (#89) Fix memory issue reported ASAN valgrind.","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-120","dir":"Changelog","previous_headings":"","what":"fs 1.2.0","title":"fs 1.2.0","text":"CRAN release: 2018-03-13","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"breaking-changes-1-2-0","dir":"Changelog","previous_headings":"","what":"Breaking changes","title":"fs 1.2.0","text":"path_expand() path_home() now use USERPROFILE HOMEDRIVE/HOMEPATH user home directory Windows. differs definition used path.expand() consistent definitions programming environments python rust. also compatible external tools git ssh, put user-level files USERPROFILE default. mimic R’s (previous) behavior functions path_expand_r() path_home_r(). Handling missing values consistent. general is_* functions always return FALSE missing values, path_* functions always propagate NA values (NA inputs become NA outputs) dir_* file_* link_* functions error NA inputs. fs functions now preserve tildes outputs. Previously paths always returned tildes expanded. Users can use path_expand() expand tildes desired.","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"bugfixes-1-2-0","dir":"Changelog","previous_headings":"","what":"Bugfixes","title":"fs 1.2.0","text":"Fix crash files user group id exist respective database (#84, #58) Fix home expansion systems without readline (#60). Fix propagation NA values path_norm() (#63).","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"features-1-2-0","dir":"Changelog","previous_headings":"","what":"Features","title":"fs 1.2.0","text":"file_chmod() now vectorized arguments (#71). link_create() now fails silently identical link already exists (#77). path_package() function created analog system.file() always fails package file exist (#75)","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-110","dir":"Changelog","previous_headings":"","what":"fs 1.1.0","title":"fs 1.1.0","text":"CRAN release: 2018-01-26","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"breaking-changes-1-1-0","dir":"Changelog","previous_headings":"","what":"Breaking changes","title":"fs 1.1.0","text":"Tidy paths longer expand ~. Filesystem modification functions now error NA inputs. (#48) path() now returns 0 length output given 0 length inputs (#54).","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"new-features-1-1-0","dir":"Changelog","previous_headings":"","what":"New features","title":"fs 1.1.0","text":"Removed autotool system dependency non-windows systems.","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"bugfixes-1-1-0","dir":"Changelog","previous_headings":"","what":"Bugfixes","title":"fs 1.1.0","text":"dir_delete() now correctly expands paths (#47). dir_delete() now correctly deletes hidden files directories (#46). link_path() now checks error trying make string, avoiding crash (#43). libuv return paths now marked UTF-8 strings C code, fixing encoding issues windows. (#42) dir_copy() now copies directory inside target target directory (#51). dir_copy() now works correctly absolute paths longer removes files overwrite = TRUE.","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-100","dir":"Changelog","previous_headings":"","what":"fs 1.0.0","title":"fs 1.0.0","text":"CRAN release: 2018-01-19 Removed libbsd system dependency linux Initial release Added NEWS.md file track changes package.","code":""}] +[{"path":[]},{"path":"https://fs.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://fs.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://fs.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://fs.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://fs.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement codeofconduct@posit.co. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://fs.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://fs.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://fs.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://fs.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://fs.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://fs.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.1, available https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. Community Impact Guidelines inspired [Mozilla’s code conduct enforcement ladder][https://github.com/mozilla/inclusion]. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"https://fs.r-lib.org/dev/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2023 fs authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://fs.r-lib.org/dev/MAINTENANCE.html","id":"current-state","dir":"","previous_headings":"","what":"Current state","title":"NA","text":"fs generally stable new development pretty rare.","code":""},{"path":"https://fs.r-lib.org/dev/MAINTENANCE.html","id":"known-outstanding-issues","dir":"","previous_headings":"","what":"Known outstanding issues","title":"NA","text":"Fairly often someone run problems compiling fs due autotools / configure problems libuv dependency. don’t great suggestions work arounds things, maybe harmonizing Makevars one httuv, also needs compile libuv. https://github.com/rstudio/httpuv/blob/main/src/Makevars outstanding issue around networked drive shares / UNC paths windows, e.g. (https://github.com/r-lib/fs/issues/296, https://github.com/r-lib/fs/issues/223, https://github.com/r-lib/fs/issues/147) partially stem deficiencies OS APIs fs node package ended going back javascript implementation avoid issues.","code":""},{"path":[]},{"path":[]},{"path":[]},{"path":"https://fs.r-lib.org/dev/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Jim Hester. Author. Hadley Wickham. Author. Gábor Csárdi. Author, maintainer. libuv project contributors. Copyright holder. libuv library Joyent, Inc. Node contributors. Copyright holder. libuv library . Copyright holder, funder.","code":""},{"path":"https://fs.r-lib.org/dev/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Hester J, Wickham H, Csárdi G (2024). fs: Cross-Platform File System Operations Based 'libuv'. R package version 1.6.4.9000, https://github.com/r-lib/fs, https://fs.r-lib.org.","code":"@Manual{, title = {fs: Cross-Platform File System Operations Based on 'libuv'}, author = {Jim Hester and Hadley Wickham and Gábor Csárdi}, year = {2024}, note = {R package version 1.6.4.9000, https://github.com/r-lib/fs}, url = {https://fs.r-lib.org}, }"},{"path":"https://fs.r-lib.org/dev/index.html","id":"fs-","dir":"","previous_headings":"","what":"Cross-Platform File System Operations Based on libuv","title":"Cross-Platform File System Operations Based on libuv","text":"fs provides cross-platform, uniform interface file system operations. shares back-end component nodejs, libuv C library, brings benefit extensive real-world use rigorous cross-platform testing. name, interface, partially inspired Rust’s fs module.","code":""},{"path":"https://fs.r-lib.org/dev/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Cross-Platform File System Operations Based on libuv","text":"can install released version fs CRAN : development version GitHub :","code":"install.packages(\"fs\") pak::pak(\"r-lib/fs\")"},{"path":"https://fs.r-lib.org/dev/index.html","id":"comparison-vs-base-equivalents","dir":"","previous_headings":"","what":"Comparison vs base equivalents","title":"Cross-Platform File System Operations Based on libuv","text":"fs functions smooth idiosyncrasies file handling base R functions: Vectorization. fs functions vectorized, accepting multiple paths input. Base functions inconsistently vectorized. Predictable return values always convey path. fs functions return character vector paths, named integer logical vector, names give paths. Base return values varied: often logical contain error codes require downstream processing. Explicit failure. fs operations fail, throw error. Base functions tend generate warning system dependent error code. makes easy miss failure. UTF-8 things. fs functions always convert input paths UTF-8 return results UTF-8. gives path encoding consistency across OSes. Base functions rely native system encoding. Naming convention. fs functions use consistent naming convention. base R’s functions gradually added time number different conventions used (e.g. path.expand() vs normalizePath(); Sys.chmod() vs file.access()).","code":""},{"path":"https://fs.r-lib.org/dev/index.html","id":"tidy-paths","dir":"","previous_headings":"Comparison vs base equivalents","what":"Tidy paths","title":"Cross-Platform File System Operations Based on libuv","text":"fs functions always return ‘tidy’ paths. Tidy paths Always use / delimit directories never multiple / trailing / Tidy paths also coloured (terminal supports ) based file permissions file type. colouring can customized extended setting LS_COLORS environment variable, output format GNU dircolors.","code":""},{"path":"https://fs.r-lib.org/dev/index.html","id":"usage","dir":"","previous_headings":"","what":"Usage","title":"Cross-Platform File System Operations Based on libuv","text":"fs functions divided four main categories: path_ manipulating constructing paths file_ files dir_ directories link_ links Directories links special types files, file_ functions generally also work applied directory link. fs designed work well pipe, though minimal-dependency infrastructure package doesn’t provide pipe . need attach magrittr similar. fs functions also work well conjunction tidyverse packages, like dplyr purrr. examples… Filter files type, permission size Tabulate display folder size. Read collection files one data frame. dir_ls() returns named vector, can used directly purrr::map_df(.id).","code":"library(fs) # Construct a path to a file with `path()` path(\"foo\", \"bar\", letters[1:3], ext = \"txt\") #> foo/bar/a.txt foo/bar/b.txt foo/bar/c.txt # list files in the current directory dir_ls() #> DESCRIPTION LICENSE LICENSE.md MAINTENANCE.md #> NAMESPACE NEWS.md R README.Rmd #> README.md _pkgdown.yml cleanup codecov.yml #> cran-comments.md fs.Rproj inst man #> man-roxygen src tests vignettes # create a new directory tmp <- dir_create(file_temp()) tmp #> /var/folders/ph/fpcmzfd16rgbbk8mxvy9m2_h0000gn/T/RtmpxNODwI/file5e375b43f7c8 # create new files in that directory file_create(path(tmp, \"my-file.txt\")) dir_ls(tmp) #> /var/folders/ph/fpcmzfd16rgbbk8mxvy9m2_h0000gn/T/RtmpxNODwI/file5e375b43f7c8/my-file.txt # remove files from the directory file_delete(path(tmp, \"my-file.txt\")) dir_ls(tmp) #> character(0) # remove the directory dir_delete(tmp) library(magrittr) paths <- file_temp() %>% dir_create() %>% path(letters[1:5]) %>% file_create() paths #> /var/folders/ph/fpcmzfd16rgbbk8mxvy9m2_h0000gn/T/RtmpxNODwI/file5e377e50d1e9/a #> /var/folders/ph/fpcmzfd16rgbbk8mxvy9m2_h0000gn/T/RtmpxNODwI/file5e377e50d1e9/b #> /var/folders/ph/fpcmzfd16rgbbk8mxvy9m2_h0000gn/T/RtmpxNODwI/file5e377e50d1e9/c #> /var/folders/ph/fpcmzfd16rgbbk8mxvy9m2_h0000gn/T/RtmpxNODwI/file5e377e50d1e9/d #> /var/folders/ph/fpcmzfd16rgbbk8mxvy9m2_h0000gn/T/RtmpxNODwI/file5e377e50d1e9/e paths %>% file_delete() suppressMessages( library(tidyverse)) dir_info(\"src\", recurse = FALSE) %>% filter(type == \"file\", permissions == \"u+r\", size > \"10KB\") %>% arrange(desc(size)) %>% select(path, permissions, size, modification_time) #> # A tibble: 12 × 4 #> path permissions size modification_time #> #> 1 src/fs.so rwxr-xr-x 309.3K 2023-07-10 18:01:44 #> 2 src/id.o rw-r--r-- 185.7K 2023-07-10 18:01:17 #> 3 src/dir.o rw-r--r-- 115.1K 2023-07-10 18:01:16 #> 4 src/path.o rw-r--r-- 113.6K 2023-07-10 18:01:18 #> 5 src/link.o rw-r--r-- 91.6K 2023-07-10 18:01:18 #> 6 src/getmode.o rw-r--r-- 83.1K 2023-07-10 18:01:17 #> 7 src/utils.o rw-r--r-- 80.8K 2023-07-10 18:01:18 #> 8 src/file.o rw-r--r-- 66.1K 2023-07-10 18:01:17 #> 9 src/init.o rw-r--r-- 20.4K 2023-07-10 18:01:17 #> 10 src/error.o rw-r--r-- 20.1K 2023-07-10 18:01:16 #> 11 src/fs.o rw-r--r-- 12K 2023-07-10 18:01:17 #> 12 src/file.cc rw-r--r-- 11.7K 2023-07-10 17:54:06 dir_info(\"src\", recurse = TRUE) %>% group_by(directory = path_dir(path)) %>% tally(wt = size, sort = TRUE) #> # A tibble: 14 × 2 #> directory n #> #> 1 src/libuv-1.44.2 2.87M #> 2 src/libuv-1.44.2/src/unix 1.46M #> 3 src 1.11M #> 4 src/libuv-1.44.2/test 1.05M #> 5 src/libuv-1.44.2/src/win 742.07K #> 6 src/libuv-1.44.2/m4 356.7K #> 7 src/libuv-1.44.2/src 353.05K #> 8 src/libuv-1.44.2/include/uv 137.44K #> 9 src/libuv-1.44.2/img 106.71K #> 10 src/unix 76.56K #> 11 src/libuv-1.44.2/include 66.23K #> 12 src/bsd 20.02K #> 13 src/windows 4.73K #> 14 src/libuv-1.44.2/test/fixtures 453 # Create separate files for each species iris %>% split(.$Species) %>% map(select, -Species) %>% iwalk(~ write_tsv(.x, paste0(.y, \".tsv\"))) # Show the files iris_files <- dir_ls(glob = \"*.tsv\") iris_files #> setosa.tsv versicolor.tsv virginica.tsv # Read the data into a single table, including the filenames iris_files %>% map_df(read_tsv, .id = \"file\", col_types = cols(), n_max = 2) #> # A tibble: 6 × 5 #> file Sepal.Length Sepal.Width Petal.Length Petal.Width #> #> 1 setosa.tsv 5.1 3.5 1.4 0.2 #> 2 setosa.tsv 4.9 3 1.4 0.2 #> 3 versicolor.tsv 7 3.2 4.7 1.4 #> 4 versicolor.tsv 6.4 3.2 4.5 1.5 #> 5 virginica.tsv 6.3 3.3 6 2.5 #> 6 virginica.tsv 5.8 2.7 5.1 1.9 file_delete(iris_files)"},{"path":"https://fs.r-lib.org/dev/index.html","id":"feedback-wanted","dir":"","previous_headings":"","what":"Feedback wanted!","title":"Cross-Platform File System Operations Based on libuv","text":"hope fs useful tool analysis scripts packages. Please open GitHub issues feature requests bugs. particular, found non-ASCII filenames non-English locales Windows especially tricky reproduce handle correctly. Feedback users use commonly situation greatly appreciated.","code":""},{"path":"https://fs.r-lib.org/dev/index.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Cross-Platform File System Operations Based on libuv","text":"Please note fs project released Contributor Code Conduct. contributing project, agree abide terms.","code":""},{"path":"https://fs.r-lib.org/dev/reference/copy.html","id":null,"dir":"Reference","previous_headings":"","what":"Copy files, directories or links — copy","title":"Copy files, directories or links — copy","text":"file_copy() copies files. link_copy() creates new link pointing location previous link. dir_copy() copies directory recursively new location.","code":""},{"path":"https://fs.r-lib.org/dev/reference/copy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Copy files, directories or links — copy","text":"","code":"file_copy(path, new_path, overwrite = FALSE) dir_copy(path, new_path, overwrite = FALSE) link_copy(path, new_path, overwrite = FALSE)"},{"path":"https://fs.r-lib.org/dev/reference/copy.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Copy files, directories or links — copy","text":"path character vector one paths. new_path character vector paths new locations. overwrite Overwrite files exist. FALSE file exists error thrown.","code":""},{"path":"https://fs.r-lib.org/dev/reference/copy.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Copy files, directories or links — copy","text":"new path (invisibly).","code":""},{"path":"https://fs.r-lib.org/dev/reference/copy.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Copy files, directories or links — copy","text":"behavior dir_copy() differs slightly file.copy() overwrite = TRUE. directory always copied new_path, even name differs basename path.","code":""},{"path":"https://fs.r-lib.org/dev/reference/copy.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Copy files, directories or links — copy","text":"","code":"file_create(\"foo\") file_copy(\"foo\", \"bar\") try(file_copy(\"foo\", \"bar\")) #> Error : [EEXIST] Failed to copy 'foo' to 'bar': file already exists file_copy(\"foo\", \"bar\", overwrite = TRUE) file_delete(c(\"foo\", \"bar\")) dir_create(\"foo\") # Create a directory and put a few files in it files <- file_create(c(\"foo/bar\", \"foo/baz\")) file_exists(files) #> foo/bar foo/baz #> TRUE TRUE # Copy the directory dir_copy(\"foo\", \"foo2\") file_exists(path(\"foo2\", path_file(files))) #> foo2/bar foo2/baz #> TRUE TRUE # Create a link to the directory link_create(path_abs(\"foo\"), \"loo\") link_path(\"loo\") #> /tmp/RtmpA3FOoQ/foo link_copy(\"loo\", \"loo2\") link_path(\"loo2\") #> /tmp/RtmpA3FOoQ/foo # Cleanup dir_delete(c(\"foo\", \"foo2\")) link_delete(c(\"loo\", \"loo2\"))"},{"path":"https://fs.r-lib.org/dev/reference/create.html","id":null,"dir":"Reference","previous_headings":"","what":"Create files, directories, or links — create","title":"Create files, directories, or links — create","text":"functions file_create() dir_create() ensure path exists; already exists left unchanged. means compared file.create(), file_create() truncate existing file, compared dir.create(), dir_create() silently ignore existing directories.","code":""},{"path":"https://fs.r-lib.org/dev/reference/create.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create files, directories, or links — create","text":"","code":"file_create(path, ..., mode = \"u=rw,go=r\") dir_create(path, ..., mode = \"u=rwx,go=rx\", recurse = TRUE, recursive) link_create(path, new_path, symbolic = TRUE)"},{"path":"https://fs.r-lib.org/dev/reference/create.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create files, directories, or links — create","text":"path character vector one paths. link_create(), target. ... Additional arguments passed path() mode file/directory created, mode ? Links mode; inherit mode file link . recurse intermediate directories created exist? recursive (Deprecated) TRUE recurse fully. new_path path link created. symbolic Boolean value determining link symbolic (default) hard link.","code":""},{"path":"https://fs.r-lib.org/dev/reference/create.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create files, directories, or links — create","text":"path created object (invisibly).","code":""},{"path":"https://fs.r-lib.org/dev/reference/create.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create files, directories, or links — create","text":"","code":"file_create(\"foo\") is_file(\"foo\") #> foo #> TRUE # dir_create applied to the same path will fail try(dir_create(\"foo\")) #> Error : [EEXIST] Failed to make directory 'foo': file already exists dir_create(\"bar\") is_dir(\"bar\") #> bar #> TRUE # file_create applied to the same path will fail try(file_create(\"bar\")) #> Error : [EISDIR] Failed to open 'bar': illegal operation on a directory # Cleanup file_delete(\"foo\") dir_delete(\"bar\")"},{"path":"https://fs.r-lib.org/dev/reference/delete.html","id":null,"dir":"Reference","previous_headings":"","what":"Delete files, directories, or links — delete","title":"Delete files, directories, or links — delete","text":"file_delete() link_delete() delete file links. Compared file.remove always fail delete object rather changing return value signalling warning. inputs directories, passed dir_delete(), file_delete() can therefore used delete filesystem object. dir_delete() first delete contents directory, remove directory. Compared unlink always throw error directory deleted rather silent signalling warning.","code":""},{"path":"https://fs.r-lib.org/dev/reference/delete.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Delete files, directories, or links — delete","text":"","code":"file_delete(path) dir_delete(path) link_delete(path)"},{"path":"https://fs.r-lib.org/dev/reference/delete.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Delete files, directories, or links — delete","text":"path character vector one paths.","code":""},{"path":"https://fs.r-lib.org/dev/reference/delete.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Delete files, directories, or links — delete","text":"deleted paths (invisibly).","code":""},{"path":"https://fs.r-lib.org/dev/reference/delete.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Delete files, directories, or links — delete","text":"","code":"# create a directory, with some files and a link to it dir_create(\"dir\") files <- file_create(path(\"dir\", letters[1:5])) link <- link_create(path_abs(\"dir\"), \"link\") # All files created dir_exists(\"dir\") #> dir #> TRUE file_exists(files) #> dir/a dir/b dir/c dir/d dir/e #> TRUE TRUE TRUE TRUE TRUE link_exists(\"link\") #> link #> TRUE file_exists(link_path(\"link\")) #> /tmp/RtmpA3FOoQ/dir #> TRUE # Delete a file file_delete(files[1]) file_exists(files[1]) #> dir/a #> FALSE # Delete the directory (which deletes the files as well) dir_delete(\"dir\") file_exists(files) #> dir/a dir/b dir/c dir/d dir/e #> FALSE FALSE FALSE FALSE FALSE dir_exists(\"dir\") #> dir #> FALSE # The link still exists, but what it points to does not. link_exists(\"link\") #> link #> TRUE dir_exists(link_path(\"link\")) #> /tmp/RtmpA3FOoQ/dir #> FALSE # Delete the link link_delete(\"link\") link_exists(\"link\") #> link #> FALSE"},{"path":"https://fs.r-lib.org/dev/reference/dir_ls.html","id":null,"dir":"Reference","previous_headings":"","what":"List files — dir_ls","title":"List files — dir_ls","text":"dir_ls() equivalent ls command. returns filenames named fs_path character vector. names equivalent values, useful passing onto functions like purrr::map_dfr(). dir_info() equivalent ls -l shortcut file_info(dir_ls()). dir_map() applies function fun() entry path returns result list. dir_walk() calls fun side-effect returns input path.","code":""},{"path":"https://fs.r-lib.org/dev/reference/dir_ls.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"List files — dir_ls","text":"","code":"dir_ls( path = \".\", all = FALSE, recurse = FALSE, type = \"any\", glob = NULL, regexp = NULL, invert = FALSE, fail = TRUE, ..., recursive ) dir_map( path = \".\", fun, all = FALSE, recurse = FALSE, type = \"any\", fail = TRUE ) dir_walk( path = \".\", fun, all = FALSE, recurse = FALSE, type = \"any\", fail = TRUE ) dir_info( path = \".\", all = FALSE, recurse = FALSE, type = \"any\", regexp = NULL, glob = NULL, fail = TRUE, ... )"},{"path":"https://fs.r-lib.org/dev/reference/dir_ls.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"List files — dir_ls","text":"path character vector one paths. TRUE hidden files also returned. recurse TRUE recurse fully, positive number number levels recurse. type File type(s) return, one \"\", \"file\", \"directory\", \"symlink\", \"FIFO\", \"socket\", \"character_device\" \"block_device\". glob wildcard aka globbing pattern (e.g. *.csv) passed grep() filter paths. regexp regular expression (e.g. [.]csv$) passed grep() filter paths. invert TRUE return files match fail call fail (default) warn file accessed. ... Additional arguments passed grep. recursive (Deprecated) TRUE recurse fully. fun function, taking one parameter, current path entry.","code":""},{"path":"https://fs.r-lib.org/dev/reference/dir_ls.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"List files — dir_ls","text":"","code":"dir_ls(R.home(\"share\"), type = \"directory\") #> /opt/R/4.4.1/lib/R/share/R #> /opt/R/4.4.1/lib/R/share/Rd #> /opt/R/4.4.1/lib/R/share/dictionaries #> /opt/R/4.4.1/lib/R/share/encodings #> /opt/R/4.4.1/lib/R/share/java #> /opt/R/4.4.1/lib/R/share/licenses #> /opt/R/4.4.1/lib/R/share/make #> /opt/R/4.4.1/lib/R/share/sh #> /opt/R/4.4.1/lib/R/share/texmf # Create a shorter link link_create(system.file(package = \"base\"), \"base\") dir_ls(\"base\", recurse = TRUE, glob = \"*.R\") #> base/demo/error.catching.R base/demo/is.things.R #> base/demo/recursion.R base/demo/scoping.R # If you need the full paths input an absolute path dir_ls(path_abs(\"base\")) #> /tmp/RtmpA3FOoQ/base/CITATION /tmp/RtmpA3FOoQ/base/DESCRIPTION #> /tmp/RtmpA3FOoQ/base/INDEX /tmp/RtmpA3FOoQ/base/Meta #> /tmp/RtmpA3FOoQ/base/R /tmp/RtmpA3FOoQ/base/demo #> /tmp/RtmpA3FOoQ/base/help /tmp/RtmpA3FOoQ/base/html dir_map(\"base\", identity) #> [[1]] #> [1] \"base/CITATION\" #> #> [[2]] #> [1] \"base/DESCRIPTION\" #> #> [[3]] #> [1] \"base/INDEX\" #> #> [[4]] #> [1] \"base/Meta\" #> #> [[5]] #> [1] \"base/R\" #> #> [[6]] #> [1] \"base/demo\" #> #> [[7]] #> [1] \"base/help\" #> #> [[8]] #> [1] \"base/html\" #> dir_walk(\"base\", str) #> chr \"base/CITATION\" #> chr \"base/DESCRIPTION\" #> chr \"base/INDEX\" #> chr \"base/Meta\" #> chr \"base/R\" #> chr \"base/demo\" #> chr \"base/help\" #> chr \"base/html\" dir_info(\"base\") #> # A tibble: 8 × 18 #> path type size permissions modification_time user group #> #> 1 base/CITATION file 643 rw-r--r-- 2024-08-22 01:58:33 root root #> 2 …se/DESCRIPTION file 383 rw-r--r-- 2024-08-22 01:58:33 root root #> 3 base/INDEX file 24.2K rw-r--r-- 2024-08-22 01:58:33 root root #> 4 base/Meta dire… 4K rwxr-xr-x 2024-10-27 09:43:27 root root #> 5 base/R dire… 4K rwxr-xr-x 2024-10-27 09:43:27 root root #> 6 base/demo dire… 4K rwxr-xr-x 2024-10-27 09:43:27 root root #> 7 base/help dire… 4K rwxr-xr-x 2024-10-27 09:43:27 root root #> 8 base/html dire… 4K rwxr-xr-x 2024-10-27 09:43:27 root root #> # ℹ 11 more variables: device_id , hard_links , #> # special_device_id , inode , block_size , blocks , #> # flags , generation , access_time , #> # change_time , birth_time # Cleanup link_delete(\"base\")"},{"path":"https://fs.r-lib.org/dev/reference/dir_tree.html","id":null,"dir":"Reference","previous_headings":"","what":"Print contents of directories in a tree-like format — dir_tree","title":"Print contents of directories in a tree-like format — dir_tree","text":"Print contents directories tree-like format","code":""},{"path":"https://fs.r-lib.org/dev/reference/dir_tree.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Print contents of directories in a tree-like format — dir_tree","text":"","code":"dir_tree(path = \".\", recurse = TRUE, ...)"},{"path":"https://fs.r-lib.org/dev/reference/dir_tree.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Print contents of directories in a tree-like format — dir_tree","text":"path path print tree recurse TRUE recurse fully, positive number number levels recurse. ... Arguments passed dir_ls type File type(s) return, one \"\", \"file\", \"directory\", \"symlink\", \"FIFO\", \"socket\", \"character_device\" \"block_device\". recursive (Deprecated) TRUE recurse fully. TRUE hidden files also returned. fail call fail (default) warn file accessed. glob wildcard aka globbing pattern (e.g. *.csv) passed grep() filter paths. regexp regular expression (e.g. [.]csv$) passed grep() filter paths. invert TRUE return files match","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_access.html","id":null,"dir":"Reference","previous_headings":"","what":"Query for existence and access permissions — file_access","title":"Query for existence and access permissions — file_access","text":"file_exists(path) shortcut file_access(x, \"exists\"); dir_exists(path) link_exists(path) similar also check path directory link, respectively. (file_exists(path) returns TRUE path exists directory.)","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_access.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Query for existence and access permissions — file_access","text":"","code":"file_access(path, mode = \"exists\") file_exists(path) dir_exists(path) link_exists(path)"},{"path":"https://fs.r-lib.org/dev/reference/file_access.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Query for existence and access permissions — file_access","text":"path character vector one paths. mode character vector containing one 'exists', 'read', 'write', 'execute'.","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_access.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Query for existence and access permissions — file_access","text":"logical vector, names corresponding input path.","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_access.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Query for existence and access permissions — file_access","text":"Cross-compatibility warning: executable bit Windows. Checking file mode 'execute' Windows, e.g. file_access(x, \"execute\") always return TRUE.","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_access.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Query for existence and access permissions — file_access","text":"","code":"file_access(\"/\") #> / #> TRUE file_access(\"/\", \"read\") #> / #> TRUE file_access(\"/\", \"write\") #> / #> FALSE file_exists(\"WOMBATS\") #> WOMBATS #> FALSE"},{"path":"https://fs.r-lib.org/dev/reference/file_chmod.html","id":null,"dir":"Reference","previous_headings":"","what":"Change file permissions — file_chmod","title":"Change file permissions — file_chmod","text":"Change file permissions","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_chmod.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Change file permissions — file_chmod","text":"","code":"file_chmod(path, mode)"},{"path":"https://fs.r-lib.org/dev/reference/file_chmod.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Change file permissions — file_chmod","text":"path character vector one paths. mode character representation mode, either hexidecimal symbolic format.","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_chmod.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Change file permissions — file_chmod","text":"Cross-compatibility warning: File permissions differ Windows POSIX systems. Windows use executable bit, attempting change effect. Windows also user groups, user permissions (u) relevant.","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_chmod.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Change file permissions — file_chmod","text":"","code":"file_create(\"foo\", mode = \"000\") file_chmod(\"foo\", \"777\") file_info(\"foo\")$permissions #> [1] rwxrwxrwx file_chmod(\"foo\", \"u-x\") file_info(\"foo\")$permissions #> [1] rw-rwxrwx file_chmod(\"foo\", \"a-wrx\") file_info(\"foo\")$permissions #> [1] --------- file_chmod(\"foo\", \"u+wr\") file_info(\"foo\")$permissions #> [1] rw------- # It is also vectorized files <- c(\"foo\", file_create(\"bar\", mode = \"000\")) file_chmod(files, \"a+rwx\") file_info(files)$permissions #> [1] rwxrwxrwx rwxrwxrwx file_chmod(files, c(\"644\", \"600\")) file_info(files)$permissions #> [1] rw-r--r-- rw-------"},{"path":"https://fs.r-lib.org/dev/reference/file_chown.html","id":null,"dir":"Reference","previous_headings":"","what":"Change owner or group of a file — file_chown","title":"Change owner or group of a file — file_chown","text":"Change owner group file","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_chown.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Change owner or group of a file — file_chown","text":"","code":"file_chown(path, user_id = NULL, group_id = NULL)"},{"path":"https://fs.r-lib.org/dev/reference/file_chown.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Change owner or group of a file — file_chown","text":"path character vector one paths. user_id user id new owner, specified numeric ID name. R process must privileged change . group_id group id new owner, specified numeric ID name.","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_info.html","id":null,"dir":"Reference","previous_headings":"","what":"Query file metadata — file_info","title":"Query file metadata — file_info","text":"Compared file.info() full results stat(2) system call returned columns returned S3 classes make manipulation natural. systems support metadata (Windows) default values used.","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_info.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Query file metadata — file_info","text":"","code":"file_info(path, fail = TRUE, follow = FALSE) file_size(path, fail = TRUE)"},{"path":"https://fs.r-lib.org/dev/reference/file_info.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Query file metadata — file_info","text":"path character vector one paths. fail call fail (default) warn file accessed. follow TRUE, symbolic links followed (recursively) results final file rather link.","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_info.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Query file metadata — file_info","text":"data.frame metadata file. Columns returned follows. path input path, fs_path() character vector. type file type, factor file types. size file size, fs_bytes() numeric vector. permissions file permissions, fs_perms() integer vector. modification_time time last data modification, POSIXct datetime. user file owner name - character vector. group file group name - character vector. device_id file device id - numeric vector. hard_links number hard links file - numeric vector. special_device_id special device id file - numeric vector. inode inode file - numeric vector. block_size optimal block file - numeric vector. blocks number blocks allocated file - numeric vector. flags user defined flags file - integer vector. generation generation number file - numeric vector. access_time time last access - POSIXct datetime. change_time time last file status change - POSIXct datetime. birth_time time inode created - POSIXct datetime.","code":""},{"path":[]},{"path":"https://fs.r-lib.org/dev/reference/file_info.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Query file metadata — file_info","text":"","code":"write.csv(mtcars, \"mtcars.csv\") file_info(\"mtcars.csv\") #> # A tibble: 1 × 18 #> path type size permissions modification_time user group #> #> 1 mtcars.csv file 1.74K rw-r--r-- 2024-10-27 09:44:30 runn… dock… #> # ℹ 11 more variables: device_id , hard_links , #> # special_device_id , inode , block_size , blocks , #> # flags , generation , access_time , #> # change_time , birth_time # Files in the working directory modified more than 20 days ago files <- file_info(dir_ls()) files$path[difftime(Sys.time(), files$modification_time, units = \"days\") > 20] #> character(0) # Cleanup file_delete(\"mtcars.csv\")"},{"path":"https://fs.r-lib.org/dev/reference/file_move.html","id":null,"dir":"Reference","previous_headings":"","what":"Move or rename files — file_move","title":"Move or rename files — file_move","text":"Compared file.rename file_move() always fails unable move file, rather signaling Warning returning error code.","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_move.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Move or rename files — file_move","text":"","code":"file_move(path, new_path)"},{"path":"https://fs.r-lib.org/dev/reference/file_move.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Move or rename files — file_move","text":"path character vector one paths. new_path New file path. new_path existing directory, file moved directory; otherwise moved/renamed full path. either length path, single directory.","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_move.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Move or rename files — file_move","text":"new path (invisibly).","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_move.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Move or rename files — file_move","text":"","code":"file_create(\"foo\") file_move(\"foo\", \"bar\") file_exists(c(\"foo\", \"bar\")) #> foo bar #> FALSE TRUE file_delete(\"bar\")"},{"path":"https://fs.r-lib.org/dev/reference/file_show.html","id":null,"dir":"Reference","previous_headings":"","what":"Open files or directories — file_show","title":"Open files or directories — file_show","text":"Open files directories","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_show.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Open files or directories — file_show","text":"","code":"file_show(path = \".\", browser = getOption(\"browser\"))"},{"path":"https://fs.r-lib.org/dev/reference/file_show.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Open files or directories — file_show","text":"path character vector one paths. browser non-empty character string giving name program used HTML browser. PATH, full path specified. Alternatively, R function called invoke browser. Windows NULL also allowed (default), implies file association mechanism used.","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_show.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Open files or directories — file_show","text":"directories opened (invisibly).","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_temp.html","id":null,"dir":"Reference","previous_headings":"","what":"Create names for temporary files — file_temp","title":"Create names for temporary files — file_temp","text":"file_temp() returns name can used temporary file.","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_temp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create names for temporary files — file_temp","text":"","code":"file_temp(pattern = \"file\", tmp_dir = tempdir(), ext = \"\") file_temp_push(path) file_temp_pop() path_temp(...)"},{"path":"https://fs.r-lib.org/dev/reference/file_temp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create names for temporary files — file_temp","text":"pattern character vector non-random portion name. tmp_dir directory file created . ext file extension temporary file. path character vector one paths. ... Additional paths appended temporary directory path().","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_temp.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create names for temporary files — file_temp","text":"file_temp_push() can used supply deterministic entries temporary file stack. can useful reproducibility like example documentation vignettes. file_temp_pop() can used explicitly remove entry internal stack, however generally done instead calling file_temp(). path_temp() constructs path within session temporary directory.","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_temp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create names for temporary files — file_temp","text":"","code":"path_temp() #> /tmp/RtmpA3FOoQ path_temp(\"does-not-exist\") #> /tmp/RtmpA3FOoQ/does-not-exist file_temp() #> /tmp/filedd461c46df20 file_temp(ext = \"png\") #> /tmp/RtmpA3FOoQ/file264717315cf8.png file_temp(\"image\", ext = \"png\") #> /tmp/RtmpA3FOoQ/image264754203c97.png # You can make the temp file paths deterministic file_temp_push(letters) file_temp() #> a file_temp() #> b # Or explicitly remove values while (!is.null(file_temp_pop())) next file_temp_pop() #> NULL"},{"path":"https://fs.r-lib.org/dev/reference/file_touch.html","id":null,"dir":"Reference","previous_headings":"","what":"Change file access and modification times — file_touch","title":"Change file access and modification times — file_touch","text":"Unlike touch POSIX utility create file exist. Use file_create() needed.","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_touch.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Change file access and modification times — file_touch","text":"","code":"file_touch(path, access_time = Sys.time(), modification_time = access_time)"},{"path":"https://fs.r-lib.org/dev/reference/file_touch.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Change file access and modification times — file_touch","text":"path character vector one paths. access_time, modification_time times set, inputs coerced POSIXct objects.","code":""},{"path":"https://fs.r-lib.org/dev/reference/file_touch.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Change file access and modification times — file_touch","text":"","code":"file_create(\"foo\") file_touch(\"foo\", \"2018-01-01\") file_info(\"foo\")[c(\"access_time\", \"modification_time\", \"change_time\", \"birth_time\")] #> # A tibble: 1 × 4 #> access_time modification_time change_time #> #> 1 2018-01-01 00:00:00 2018-01-01 00:00:00 2024-10-27 09:44:31 #> # ℹ 1 more variable: birth_time "},{"path":"https://fs.r-lib.org/dev/reference/fs-package.html","id":null,"dir":"Reference","previous_headings":"","what":"fs: Cross-Platform File System Operations Based on 'libuv' — fs-package","title":"fs: Cross-Platform File System Operations Based on 'libuv' — fs-package","text":"cross-platform interface file system operations, built top 'libuv' C library.","code":""},{"path":[]},{"path":"https://fs.r-lib.org/dev/reference/fs-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"fs: Cross-Platform File System Operations Based on 'libuv' — fs-package","text":"Maintainer: Gábor Csárdi csardi.gabor@gmail.com Authors: Jim Hester Hadley Wickham hadley@posit.co contributors: libuv project contributors (libuv library) [copyright holder] Joyent, Inc. Node contributors (libuv library) [copyright holder] Posit Software, PBC [copyright holder, funder]","code":""},{"path":"https://fs.r-lib.org/dev/reference/fs_bytes.html","id":null,"dir":"Reference","previous_headings":"","what":"Human readable file sizes — fs_bytes","title":"Human readable file sizes — fs_bytes","text":"Construct, manipulate display vectors file sizes. numeric vectors, can compare numerically, can also compared human readable values '10MB'.","code":""},{"path":"https://fs.r-lib.org/dev/reference/fs_bytes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Human readable file sizes — fs_bytes","text":"","code":"as_fs_bytes(x) fs_bytes(x)"},{"path":"https://fs.r-lib.org/dev/reference/fs_bytes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Human readable file sizes — fs_bytes","text":"x numeric character vector. Character representations can use shorthand sizes (see examples).","code":""},{"path":"https://fs.r-lib.org/dev/reference/fs_bytes.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Human readable file sizes — fs_bytes","text":"","code":"fs_bytes(\"1\") #> 1 fs_bytes(\"1K\") #> 1K fs_bytes(\"1Kb\") #> 1K fs_bytes(\"1Kib\") #> 1K fs_bytes(\"1MB\") #> 1M fs_bytes(\"1KB\") < \"1MB\" #> [1] TRUE sum(fs_bytes(c(\"1MB\", \"5MB\", \"500KB\"))) #> 6.49M"},{"path":"https://fs.r-lib.org/dev/reference/fs_path.html","id":null,"dir":"Reference","previous_headings":"","what":"File paths — fs_path","title":"File paths — fs_path","text":"Tidy file paths, character vectors coloured file type capable terminals. Colouring can customized setting LS_COLORS environment variable, format read GNU ls / dircolors. Colouring file paths can disabled setting LS_COLORS empty string e.g. Sys.setenv(LS_COLORS = \"\").","code":""},{"path":"https://fs.r-lib.org/dev/reference/fs_path.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"File paths — fs_path","text":"","code":"as_fs_path(x) fs_path(x)"},{"path":"https://fs.r-lib.org/dev/reference/fs_path.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"File paths — fs_path","text":"x vector coerced fs_path object.","code":""},{"path":[]},{"path":"https://fs.r-lib.org/dev/reference/fs_perms.html","id":null,"dir":"Reference","previous_headings":"","what":"Create, modify and view file permissions — fs_perms","title":"Create, modify and view file permissions — fs_perms","text":"fs_perms() objects help one create modify file permissions easily. support numeric input, octal symbolic character representations. Compared octmode support symbolic representations display mode format ls POSIX systems.","code":""},{"path":"https://fs.r-lib.org/dev/reference/fs_perms.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create, modify and view file permissions — fs_perms","text":"","code":"as_fs_perms(x, ...) fs_perms(x, ...)"},{"path":"https://fs.r-lib.org/dev/reference/fs_perms.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create, modify and view file permissions — fs_perms","text":"x object coerced fs_perms object. Can number octal character representation, including symbolic representations. ... Additional arguments passed methods.","code":""},{"path":"https://fs.r-lib.org/dev/reference/fs_perms.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create, modify and view file permissions — fs_perms","text":"POSIX systems permissions displayed 9 character string three sets three characters. set corresponds permissions user, group (default) users. first character set \"r\", file readable users, \"-\", readable. second character set \"w\", file writable users, \"-\", writable. third character complex, first following characters apply. 'S' character part owner permissions file executable directory searchable owner, set-user-id bit set. 'S' character part group permissions file executable directory searchable group, set-group-id bit set. 'T' character part permissions file executable directory searchable others, 'sticky' (S_ISVTX) bit set. 's' character part owner permissions file executable directory searchable owner, set-user-id bit set. 's' character part group permissions file executable directory searchable group, set-group-id bit set. 't' character part permissions file executable directory searchable others, ”sticky” (S_ISVTX) bit set. 'x' file executable directory searchable. '-' none apply. commonly third character either 'x' -. Windows permissions displayed 3 character string third character - x.","code":""},{"path":"https://fs.r-lib.org/dev/reference/fs_perms.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create, modify and view file permissions — fs_perms","text":"","code":"# Integer and numeric fs_perms(420L) #> [1] rw-r--r-- fs_perms(c(511, 420)) #> [1] rwxrwxrwx rw-r--r-- # Octal fs_perms(\"777\") #> [1] rwxrwxrwx fs_perms(c(\"777\", \"644\")) #> [1] rwxrwxrwx rw-r--r-- # Symbolic fs_perms(\"a+rwx\") #> [1] rwxrwxrwx fs_perms(c(\"a+rwx\", \"u+rw,go+r\")) #> [1] rwxrwxrwx rw-r--r-- # Use the `&` and `|`operators to check for certain permissions (fs_perms(\"777\") & \"u+r\") == \"u+r\" #> [1] TRUE"},{"path":"https://fs.r-lib.org/dev/reference/id.html","id":null,"dir":"Reference","previous_headings":"","what":"Lookup Users and Groups on a system — id","title":"Lookup Users and Groups on a system — id","text":"functions use GETPWENT(3) GETGRENT(3) system calls query users groups respectively.","code":""},{"path":"https://fs.r-lib.org/dev/reference/id.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Lookup Users and Groups on a system — id","text":"","code":"group_ids() user_ids()"},{"path":"https://fs.r-lib.org/dev/reference/id.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Lookup Users and Groups on a system — id","text":"return results data.frame. windows functions return empty data.frame windows user group ids.","code":""},{"path":"https://fs.r-lib.org/dev/reference/id.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Lookup Users and Groups on a system — id","text":"","code":"# list first 6 groups head(group_ids()) #> group_id group_name #> 1 0 root #> 2 1 daemon #> 3 2 bin #> 4 3 sys #> 5 4 adm #> 6 5 tty # list first 6 users head(user_ids()) #> user_id user_name #> 1 0 root #> 2 1 daemon #> 3 2 bin #> 4 3 sys #> 5 4 sync #> 6 5 games"},{"path":"https://fs.r-lib.org/dev/reference/is_absolute_path.html","id":null,"dir":"Reference","previous_headings":"","what":"Test if a path is an absolute path — is_absolute_path","title":"Test if a path is an absolute path — is_absolute_path","text":"Test path absolute path","code":""},{"path":"https://fs.r-lib.org/dev/reference/is_absolute_path.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Test if a path is an absolute path — is_absolute_path","text":"","code":"is_absolute_path(path)"},{"path":"https://fs.r-lib.org/dev/reference/is_absolute_path.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Test if a path is an absolute path — is_absolute_path","text":"path character vector one paths.","code":""},{"path":"https://fs.r-lib.org/dev/reference/is_absolute_path.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Test if a path is an absolute path — is_absolute_path","text":"","code":"is_absolute_path(\"/foo\") #> [1] TRUE is_absolute_path(\"C:\\\\foo\") #> [1] TRUE is_absolute_path(\"\\\\\\\\myserver\\\\foo\\\\bar\") #> [1] TRUE is_absolute_path(\"foo/bar\") #> [1] FALSE"},{"path":"https://fs.r-lib.org/dev/reference/is_file.html","id":null,"dir":"Reference","previous_headings":"","what":"Functions to test for file types — is_file","title":"Functions to test for file types — is_file","text":"Functions test file types","code":""},{"path":"https://fs.r-lib.org/dev/reference/is_file.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Functions to test for file types — is_file","text":"","code":"is_file(path, follow = TRUE) is_dir(path, follow = TRUE) is_link(path) is_file_empty(path, follow = TRUE)"},{"path":"https://fs.r-lib.org/dev/reference/is_file.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Functions to test for file types — is_file","text":"path character vector one paths. follow TRUE, symbolic links followed (recursively) results final file rather link.","code":""},{"path":"https://fs.r-lib.org/dev/reference/is_file.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Functions to test for file types — is_file","text":"named logical vector, names give paths. given object exist, NA returned.","code":""},{"path":[]},{"path":"https://fs.r-lib.org/dev/reference/is_file.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Functions to test for file types — is_file","text":"","code":"dir_create(\"d\") file_create(\"d/file.txt\") dir_create(\"d/dir\") link_create(path(path_abs(\"d\"), \"file.txt\"), \"d/link\") paths <- dir_ls(\"d\") is_file(paths) #> d/dir d/file.txt d/link #> FALSE TRUE TRUE is_dir(paths) #> d/dir d/file.txt d/link #> TRUE FALSE FALSE is_link(paths) #> d/dir d/file.txt d/link #> FALSE FALSE TRUE # Cleanup dir_delete(\"d\")"},{"path":"https://fs.r-lib.org/dev/reference/link_path.html","id":null,"dir":"Reference","previous_headings":"","what":"Read the value of a symbolic link — link_path","title":"Read the value of a symbolic link — link_path","text":"Read value symbolic link","code":""},{"path":"https://fs.r-lib.org/dev/reference/link_path.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read the value of a symbolic link — link_path","text":"","code":"link_path(path)"},{"path":"https://fs.r-lib.org/dev/reference/link_path.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read the value of a symbolic link — link_path","text":"path character vector one paths.","code":""},{"path":"https://fs.r-lib.org/dev/reference/link_path.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read the value of a symbolic link — link_path","text":"tidy path object link points .","code":""},{"path":"https://fs.r-lib.org/dev/reference/link_path.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read the value of a symbolic link — link_path","text":"","code":"file_create(\"foo\") link_create(path_abs(\"foo\"), \"bar\") link_path(\"bar\") #> /tmp/RtmpA3FOoQ/foo # Cleanup file_delete(c(\"foo\", \"bar\"))"},{"path":"https://fs.r-lib.org/dev/reference/path.html","id":null,"dir":"Reference","previous_headings":"","what":"Construct path to a file or directory — path","title":"Construct path to a file or directory — path","text":"path() constructs relative path, path_wd() constructs absolute path current working directory.","code":""},{"path":"https://fs.r-lib.org/dev/reference/path.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Construct path to a file or directory — path","text":"","code":"path(..., ext = \"\") path_wd(..., ext = \"\")"},{"path":"https://fs.r-lib.org/dev/reference/path.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Construct path to a file or directory — path","text":"... character vectors, values NA, result also NA. paths follow recycling rules used tibble package, namely length 1 arguments recycled. ext optional extension append generated path.","code":""},{"path":[]},{"path":"https://fs.r-lib.org/dev/reference/path.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Construct path to a file or directory — path","text":"","code":"path(\"foo\", \"bar\", \"baz\", ext = \"zip\") #> foo/bar/baz.zip path(\"foo\", letters[1:3], ext = \"txt\") #> foo/a.txt foo/b.txt foo/c.txt"},{"path":"https://fs.r-lib.org/dev/reference/path_expand.html","id":null,"dir":"Reference","previous_headings":"","what":"Finding the User Home Directory — path_expand","title":"Finding the User Home Directory — path_expand","text":"path_expand() performs tilde expansion path, replacing instances ~ ~user user's home directory. path_home() constructs path within expanded users home directory, calling arguments can useful verify fs considers home directory. path_expand_r() path_home_r() equivalents always use R's definition home directory.","code":""},{"path":"https://fs.r-lib.org/dev/reference/path_expand.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Finding the User Home Directory — path_expand","text":"","code":"path_expand(path) path_expand_r(path) path_home(...) path_home_r(...)"},{"path":"https://fs.r-lib.org/dev/reference/path_expand.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Finding the User Home Directory — path_expand","text":"path character vector one paths. ... Additional paths appended home directory path().","code":""},{"path":"https://fs.r-lib.org/dev/reference/path_expand.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Finding the User Home Directory — path_expand","text":"path_expand() differs base::path.expand() interpretation home directory Windows. particular path_expand() uses path set USERPROFILE environment variable , unset, uses HOMEDRIVE/HOMEPATH. contrast base::path.expand() first checks R_USER HOME, default configuration R Windows set user's document directory, e.g. C:\\\\Users\\\\username\\\\Documents. base::path.expand() also support ~otheruser syntax Windows, whereas path_expand() support syntax systems. definition makes fs consistent definition home directory used Windows languages, python rust. also compatible external tools git ssh, put user-level files USERPROFILE default. also allows write portable paths, ~/Desktop points Desktop location Windows, macOS () Linux systems. Users can set R_FS_HOME environment variable override definitions platform.","code":""},{"path":[]},{"path":"https://fs.r-lib.org/dev/reference/path_expand.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Finding the User Home Directory — path_expand","text":"","code":"# Expand a path path_expand(\"~/bin\") #> /home/runner/bin # You can use `path_home()` without arguments to see what is being used as # the home diretory. path_home() #> /home/runner path_home(\"R\") #> /home/runner/R # This will likely differ from the above on Windows path_home_r() #> /home/runner"},{"path":"https://fs.r-lib.org/dev/reference/path_file.html","id":null,"dir":"Reference","previous_headings":"","what":"Manipulate file paths — path_file","title":"Manipulate file paths — path_file","text":"path_file() returns filename portion path, path_dir() returns directory portion. path_ext() returns last extension () path. path_ext_remove() removes last extension returns rest path. path_ext_set() replaces extension new extension. existing extension new extension appended.","code":""},{"path":"https://fs.r-lib.org/dev/reference/path_file.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Manipulate file paths — path_file","text":"","code":"path_file(path) path_dir(path) path_ext(path) path_ext_remove(path) path_ext_set(path, ext) path_ext(path) <- value"},{"path":"https://fs.r-lib.org/dev/reference/path_file.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Manipulate file paths — path_file","text":"path character vector one paths. ext, value new file extension.","code":""},{"path":"https://fs.r-lib.org/dev/reference/path_file.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Manipulate file paths — path_file","text":"Note full file paths return regular character vectors, fs_path() objects.","code":""},{"path":[]},{"path":"https://fs.r-lib.org/dev/reference/path_file.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Manipulate file paths — path_file","text":"","code":"path_file(\"dir/file.zip\") #> [1] \"file.zip\" path_dir(\"dir/file.zip\") #> [1] \"dir\" path_ext(\"dir/file.zip\") #> [1] \"zip\" path_ext(\"file.tar.gz\") #> [1] \"gz\" path_ext_remove(\"file.tar.gz\") #> [1] \"file.tar\" # Only one level of extension is removed path_ext_set(path_ext_remove(\"file.tar.gz\"), \"zip\") #> file.zip"},{"path":"https://fs.r-lib.org/dev/reference/path_filter.html","id":null,"dir":"Reference","previous_headings":"","what":"Filter paths — path_filter","title":"Filter paths — path_filter","text":"Filter paths","code":""},{"path":"https://fs.r-lib.org/dev/reference/path_filter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Filter paths — path_filter","text":"","code":"path_filter(path, glob = NULL, regexp = NULL, invert = FALSE, ...)"},{"path":"https://fs.r-lib.org/dev/reference/path_filter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Filter paths — path_filter","text":"path character vector one paths. glob wildcard aka globbing pattern (e.g. *.csv) passed grep() filter paths. regexp regular expression (e.g. [.]csv$) passed grep() filter paths. invert TRUE return files match ... Additional arguments passed grep.","code":""},{"path":"https://fs.r-lib.org/dev/reference/path_filter.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Filter paths — path_filter","text":"","code":"path_filter(c(\"foo\", \"boo\", \"bar\"), glob = \"*oo\") #> foo boo path_filter(c(\"foo\", \"boo\", \"bar\"), glob = \"*oo\", invert = TRUE) #> bar path_filter(c(\"foo\", \"boo\", \"bar\"), regexp = \"b.r\") #> bar"},{"path":"https://fs.r-lib.org/dev/reference/path_math.html","id":null,"dir":"Reference","previous_headings":"","what":"Path computations — path_math","title":"Path computations — path_math","text":"functions apart path_real() purely path computations, files question need exist filesystem.","code":""},{"path":"https://fs.r-lib.org/dev/reference/path_math.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Path computations — path_math","text":"","code":"path_real(path) path_split(path) path_join(parts) path_abs(path, start = \".\") path_norm(path) path_rel(path, start = \".\") path_common(path) path_has_parent(path, parent)"},{"path":"https://fs.r-lib.org/dev/reference/path_math.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Path computations — path_math","text":"path character vector one paths. parts character vector list character vectors, corresponding split paths. start starting directory compute path relative . parent parent path.","code":""},{"path":"https://fs.r-lib.org/dev/reference/path_math.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Path computations — path_math","text":"new path(s) fs_path object, character vector also class fs_path. Except path_split(), returns list character vectors path components.","code":""},{"path":"https://fs.r-lib.org/dev/reference/path_math.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Path computations — path_math","text":"path_real(): returns canonical path, eliminating symbolic links special references ~, ~user, ., .., , .e. calls path_expand() (literally) path_norm() (effectively). path_split(): splits paths parts. path_join(): joins parts together. inverse path_split(). See path() concatenate vectorized strings path. path_abs(): returns normalized, absolute version path. path_norm(): eliminates . references rationalizes -level .. references, /./B /foo/../B become /B, ../B changed. one paths symbolic link, may change meaning path, consider using path_real() instead. path_rel(): computes path relative start path, can either absolute relative path. path_common(): finds common parts two () paths. path_has_parent(): determine path given parent.","code":""},{"path":[]},{"path":"https://fs.r-lib.org/dev/reference/path_math.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Path computations — path_math","text":"","code":"dir_create(\"a\") file_create(\"a/b\") link_create(path_abs(\"a\"), \"c\") # Realize the path path_real(\"c/b\") #> /tmp/RtmpA3FOoQ/a/b # Split a path parts <- path_split(\"a/b\") parts #> [[1]] #> [1] \"a\" \"b\" #> # Join it together path_join(parts) #> a/b # Find the absolute path path_abs(\"..\") #> /tmp # Normalize a path path_norm(\"a/../b\\\\c/.\") #> b/c # Compute a relative path path_rel(\"/foo/abc\", \"/foo/bar/baz\") #> ../../abc # Find the common path between multiple paths path_common(c(\"/foo/bar/baz\", \"/foo/bar/abc\", \"/foo/xyz/123\")) #> /foo # Cleanup dir_delete(\"a\") link_delete(\"c\")"},{"path":"https://fs.r-lib.org/dev/reference/path_package.html","id":null,"dir":"Reference","previous_headings":"","what":"Construct a path to a location within an installed or development package — path_package","title":"Construct a path to a location within an installed or development package — path_package","text":"path_package differs system.file() always returns error package exist. also returns different error file within package exist.","code":""},{"path":"https://fs.r-lib.org/dev/reference/path_package.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Construct a path to a location within an installed or development package — path_package","text":"","code":"path_package(package, ...)"},{"path":"https://fs.r-lib.org/dev/reference/path_package.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Construct a path to a location within an installed or development package — path_package","text":"package Name package search ... Additional paths appended package path path().","code":""},{"path":"https://fs.r-lib.org/dev/reference/path_package.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Construct a path to a location within an installed or development package — path_package","text":"path_package() also automatically works packages loaded devtools even path_package() call comes different package.","code":""},{"path":"https://fs.r-lib.org/dev/reference/path_package.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Construct a path to a location within an installed or development package — path_package","text":"","code":"path_package(\"base\") #> /opt/R/4.4.1/lib/R/library/base path_package(\"stats\") #> /opt/R/4.4.1/lib/R/library/stats path_package(\"base\", \"INDEX\") #> /opt/R/4.4.1/lib/R/library/base/INDEX path_package(\"splines\", \"help\", \"AnIndex\") #> /opt/R/4.4.1/lib/R/library/splines/help/AnIndex"},{"path":"https://fs.r-lib.org/dev/reference/path_sanitize.html","id":null,"dir":"Reference","previous_headings":"","what":"Sanitize a filename by removing directory paths and invalid characters — path_sanitize","title":"Sanitize a filename by removing directory paths and invalid characters — path_sanitize","text":"path_sanitize() removes following: Control characters Reserved characters Unix reserved filenames (. ..) Trailing periods spaces (invalid Windows) Windows reserved filenames (CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, LPT9) resulting string truncated 255 bytes length","code":""},{"path":"https://fs.r-lib.org/dev/reference/path_sanitize.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Sanitize a filename by removing directory paths and invalid characters — path_sanitize","text":"","code":"path_sanitize(filename, replacement = \"\")"},{"path":"https://fs.r-lib.org/dev/reference/path_sanitize.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Sanitize a filename by removing directory paths and invalid characters — path_sanitize","text":"filename character vector sanitized. replacement character vector used replace invalid characters.","code":""},{"path":[]},{"path":"https://fs.r-lib.org/dev/reference/path_sanitize.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Sanitize a filename by removing directory paths and invalid characters — path_sanitize","text":"","code":"# potentially unsafe string str <- \"~/.\\u0001ssh/authorized_keys\" path_sanitize(str) #> [1] \"~.sshauthorized_keys\" path_sanitize(\"..\") #> [1] \"\""},{"path":"https://fs.r-lib.org/dev/reference/path_tidy.html","id":null,"dir":"Reference","previous_headings":"","what":"Tidy paths — path_tidy","title":"Tidy paths — path_tidy","text":"untidy paths different, tidy paths . Tidy paths always use / delimit directories, never multiple / trailing / colourised output based file type.","code":""},{"path":"https://fs.r-lib.org/dev/reference/path_tidy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Tidy paths — path_tidy","text":"","code":"path_tidy(path)"},{"path":"https://fs.r-lib.org/dev/reference/path_tidy.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Tidy paths — path_tidy","text":"path character vector one paths.","code":""},{"path":"https://fs.r-lib.org/dev/reference/path_tidy.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Tidy paths — path_tidy","text":"fs_path object, character vector also class fs_path","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-development-version","dir":"Changelog","previous_headings":"","what":"fs (development version)","title":"fs (development version)","text":"path_ext() path_ext_remove() return correct extension path, respectively, multiple dots present file name (@IndrajeetPatil, #452, #453). path_rel() provides informative error message multiple starting directory paths specified (@IndrajeetPatil, #454).","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-164","dir":"Changelog","previous_headings":"","what":"fs 1.6.4","title":"fs 1.6.4","text":"CRAN release: 2024-04-25 changes.","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-163","dir":"Changelog","previous_headings":"","what":"fs 1.6.3","title":"fs 1.6.3","text":"CRAN release: 2023-07-20 user visible changes.","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-162","dir":"Changelog","previous_headings":"","what":"fs 1.6.2","title":"fs 1.6.2","text":"CRAN release: 2023-04-25 path_ext_set() can now handle extensions contain ., e.g. csv.gz (@mgirlich, #415).","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-161","dir":"Changelog","previous_headings":"","what":"fs 1.6.1","title":"fs 1.6.1","text":"CRAN release: 2023-02-06 user visible changes.","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-160","dir":"Changelog","previous_headings":"","what":"fs 1.6.0","title":"fs 1.6.0","text":"CRAN release: 2023-01-23 inputs path_real() path_join() coerced character consistency functions (@raymondben, #370) fs uses libuv 1.44.2 now.","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-152","dir":"Changelog","previous_headings":"","what":"fs 1.5.2","title":"fs 1.5.2","text":"CRAN release: 2021-12-08 file_create() dir_create() now return correct path ... arguments used (@davidchall, #333). dir_create(recurse = FALSE) now correctly handles ... arguments (@davidchall, #333). file_exists() now expands ~ (#325). dir_copy() works path length >1 (#360).","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-151","dir":"Changelog","previous_headings":"","what":"fs 1.5.1","title":"fs 1.5.1","text":"CRAN release: 2021-11-30 Gábor Csárdi now maintainer. fs now licensed MIT (#301). dir_create() now restores previous umask (#293) file_exists() now much faster (#295) options(fs.fs_path.shorten) can now used control paths shortened tibbles. default value “front”, valid alternatives “back”, “middle” “abbreviate”. (#335) options(fs.use_tibble = FALSE) can now used disable use tibbles (#295). path_tidy() now works non-UTF8 encoded paths (@shrektan, #321).","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-150","dir":"Changelog","previous_headings":"","what":"fs 1.5.0","title":"fs 1.5.0","text":"CRAN release: 2020-07-31 libuv release used fs updated 1.38.1 dir_create() now consults process umask mode directory creation works like mkdir (#284). fs_path, fs_bytes fs_perms objects now compatible vctrs 0.3.0 (#266) fs_path objects now sort properly mix ASCII unicode elements (#279)","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-142","dir":"Changelog","previous_headings":"","what":"fs 1.4.2","title":"fs 1.4.2","text":"CRAN release: 2020-06-30 file_info(..., follow = TRUE), is_dir(), is_file() follow relative symlinks non-current directories (@heavywatal, #280) dir_map() now grows internal list safely, 1.4.0 release introduced unsafe regression (#268) file_info() returns tibble tibble package installed, subsets work data.frame (#265) path_real() always fails file exist. Thus can longer used resolve symlinks path hierarchy files yet exist. reverts feature introduced 1.2.7 (#144, #221, #231)","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-141","dir":"Changelog","previous_headings":"","what":"fs 1.4.1","title":"fs 1.4.1","text":"CRAN release: 2020-04-03 Fix compilation Solaris.","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-140","dir":"Changelog","previous_headings":"","what":"fs 1.4.0","title":"fs 1.4.0","text":"CRAN release: 2020-03-31 [[.fs_path, [[.fs_bytes [[.fs_perms now preserve classes subsetting (#254). path_has_parent() now recycles path parent arguments (#253). path_ext_set() now recycles path ext arguments (#250). Internally fs longer depends Rcpp","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-132","dir":"Changelog","previous_headings":"","what":"fs 1.3.2","title":"fs 1.3.2","text":"CRAN release: 2020-03-05 fs now passes along CPPFLAGS compilation libuv, fixing issue prevent compilation source macOS Catalina. (@kevinushey, #229) fs now compiles alpine linux (#210) dir_create() now works absolute paths recurse = FALSE (#204). dir_tree() now works paths need tilde expansion (@dmurdoch, @jennybc, #203). file_info() now returns file sizes proper classes (“fs_bytes” “numeric”), rather just “fs_bytes” (#239) get_dirent_type() gains fail argument (@bellma-lilly, #219) is_dir(), is_file(), is_file_empty() file_info() gain follow argument, follow links return information linked file rather link (#198) path() now follows “tidy” recycling rules, namely consistent length 1 inputs recycled. (#238) path() now errors path given constructed exceed PATH_MAX (#233). path_ext_set() now works multiple paths (@maurolepore, #208).","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-131","dir":"Changelog","previous_headings":"","what":"fs 1.3.1","title":"fs 1.3.1","text":"CRAN release: 2019-05-06 Fix missed test UTF-8 characters, now passes strict Latin-1 locale. Fix undefined behavior casting -1 size_t.","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-130","dir":"Changelog","previous_headings":"","what":"fs 1.3.0","title":"fs 1.3.0","text":"CRAN release: 2019-05-02","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"breaking-changes-1-3-0","dir":"Changelog","previous_headings":"","what":"Breaking changes","title":"fs 1.3.0","text":"dir_ls(), dir_map(), dir_walk(), dir_info() dir_tree() gain recurse argument, can either TRUE FALSE (supported previously) number levels recurse. previous argument recursive deprecated.","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"new-features-1-3-0","dir":"Changelog","previous_headings":"","what":"New features","title":"fs 1.3.0","text":"dir_copy() gains overwrite argument, overwrite given directory (@pasipasi123, #193)","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"minor-improvements-and-fixes-1-3-0","dir":"Changelog","previous_headings":"","what":"Minor improvements and fixes","title":"fs 1.3.0","text":"dir_create() now throws accurate error message try create directory non-writeable location (#196). fs_path objects now always show 10 characters default printed tibbles (#191). path_file(), path_dir() path_ext() now return normal character vectors rather tidy paths (#194). path_package() now works paths development packages automatically (#175). tests now pass successfully run strict Latin-1 locale","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-127","dir":"Changelog","previous_headings":"","what":"fs 1.2.7","title":"fs 1.2.7","text":"CRAN release: 2019-03-19","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"new-features-1-2-7","dir":"Changelog","previous_headings":"","what":"New features","title":"fs 1.2.7","text":"file_size() function added helper file_info(\"file\")$size (#171) is_file_empty() function added test empty files` (#171) dir_tree() function added print command line representation directory tree, analogous unix tree program (#82). Add comparison vignette quickly compare base R, fs shell alternatives (@xvrdm, #168).","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"minor-improvements-and-fixes-1-2-7","dir":"Changelog","previous_headings":"","what":"Minor improvements and fixes","title":"fs 1.2.7","text":"path_ext_set() file_temp() now treat extensions leading . without equally. e.g. path_ext_set(\"foo\", ext = \"bar\") path_ext_set(\"foo\", ext = \".bar\") result “foo.bar” Tidy paths now always returned uppercase drive letters Windows (#174). format.bench_bytes() now works str() R 3.5.1+ (#155). path_ext(), path_ext_remove(), path_ext_set() now work paths extension, file_temp() now prepends . file extension (#153). Link -pthread default fix BSD systems (#128, #145, #146). file_chown() can now take group_id parameter character (@cderv, #162). Parameter browser file_show() now works described documentation (@GegznaV, #154). path_real() now works even file exist, symlinks path hierarchy (#144). colourise_fs_path() now returns paths uncolored colors argument / LS_COLORS malformed (#135).","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-126","dir":"Changelog","previous_headings":"","what":"fs 1.2.6","title":"fs 1.2.6","text":"CRAN release: 2018-08-23 small bugfix release. file_move() now fall back copying, removing files moving files devices (otherwise fail) (#131, https://github.com/r-lib/usethis/issues/438). Fix double free using warn = TRUE (#132)","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-125","dir":"Changelog","previous_headings":"","what":"fs 1.2.5","title":"fs 1.2.5","text":"CRAN release: 2018-07-30 Patch release fix tests left files R session directory","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-124","dir":"Changelog","previous_headings":"","what":"fs 1.2.4","title":"fs 1.2.4","text":"CRAN release: 2018-07-26","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"new-features-1-2-4","dir":"Changelog","previous_headings":"","what":"New Features","title":"fs 1.2.4","text":"New path_wd() generates paths current working directory (#122). New path_has_parent() determines path given parent (#116). New file_touch() used change access modification times file (#98). dir_ls(), dir_map(), dir_walk(), dir_info() file_info() gain fail parameter, signal warnings rather errors called path unavailable due permissions locked resources (#105).","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"minor-improvements-and-fixes-1-2-4","dir":"Changelog","previous_headings":"","what":"Minor improvements and fixes","title":"fs 1.2.4","text":"path_tidy() now always includes trailing slash windows root directory, e.g. C:/ (#124). path_ext(), path_ext_set() path_ext_remove() now handle paths non-ASCII characters (#120). fs_path objects now print (without colors) even user permission stat (#121). compatibility upcoming gcc 8 based Windows toolchain (#119)","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-123","dir":"Changelog","previous_headings":"","what":"fs 1.2.3","title":"fs 1.2.3","text":"CRAN release: 2018-06-08","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"features-1-2-3","dir":"Changelog","previous_headings":"","what":"Features","title":"fs 1.2.3","text":"Experimental support / + methods fs_path objects (#110). file_create() dir_create() now take ..., passed path() make construction little nicer (#80).","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"bugfixes-1-2-3","dir":"Changelog","previous_headings":"","what":"Bugfixes","title":"fs 1.2.3","text":"path_ext(), path_ext_set() path_ext_remove() now handle paths directories including hidden files without extensions (#92). file_copy() now copies files directory target directory (#102).","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-122","dir":"Changelog","previous_headings":"","what":"fs 1.2.2","title":"fs 1.2.2","text":"CRAN release: 2018-03-21","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"features-1-2-2","dir":"Changelog","previous_headings":"","what":"Features","title":"fs 1.2.2","text":"fs longer needs C++11 compiler, now works compilers support C++03 (#90).","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"bugfixes-1-2-2","dir":"Changelog","previous_headings":"","what":"Bugfixes","title":"fs 1.2.2","text":"fs_path fs_bytes fs_perm objects now use methods::setOldClass() S4 dispatch base classes works intended (#91). Fix allocation bug path_exists() using delete [] used free().","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-121","dir":"Changelog","previous_headings":"","what":"fs 1.2.1","title":"fs 1.2.1","text":"CRAN release: 2018-03-20","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"features-1-2-1","dir":"Changelog","previous_headings":"","what":"Features","title":"fs 1.2.1","text":"path_abs() gains start argument, specify absolute path calculated (#87).","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"bugfixes-1-2-1","dir":"Changelog","previous_headings":"","what":"Bugfixes","title":"fs 1.2.1","text":"path_ext() now returns character() given 0 length inputs (#89) Fix memory issue reported ASAN valgrind.","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-120","dir":"Changelog","previous_headings":"","what":"fs 1.2.0","title":"fs 1.2.0","text":"CRAN release: 2018-03-13","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"breaking-changes-1-2-0","dir":"Changelog","previous_headings":"","what":"Breaking changes","title":"fs 1.2.0","text":"path_expand() path_home() now use USERPROFILE HOMEDRIVE/HOMEPATH user home directory Windows. differs definition used path.expand() consistent definitions programming environments python rust. also compatible external tools git ssh, put user-level files USERPROFILE default. mimic R’s (previous) behavior functions path_expand_r() path_home_r(). Handling missing values consistent. general is_* functions always return FALSE missing values, path_* functions always propagate NA values (NA inputs become NA outputs) dir_* file_* link_* functions error NA inputs. fs functions now preserve tildes outputs. Previously paths always returned tildes expanded. Users can use path_expand() expand tildes desired.","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"bugfixes-1-2-0","dir":"Changelog","previous_headings":"","what":"Bugfixes","title":"fs 1.2.0","text":"Fix crash files user group id exist respective database (#84, #58) Fix home expansion systems without readline (#60). Fix propagation NA values path_norm() (#63).","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"features-1-2-0","dir":"Changelog","previous_headings":"","what":"Features","title":"fs 1.2.0","text":"file_chmod() now vectorized arguments (#71). link_create() now fails silently identical link already exists (#77). path_package() function created analog system.file() always fails package file exist (#75)","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-110","dir":"Changelog","previous_headings":"","what":"fs 1.1.0","title":"fs 1.1.0","text":"CRAN release: 2018-01-26","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"breaking-changes-1-1-0","dir":"Changelog","previous_headings":"","what":"Breaking changes","title":"fs 1.1.0","text":"Tidy paths longer expand ~. Filesystem modification functions now error NA inputs. (#48) path() now returns 0 length output given 0 length inputs (#54).","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"new-features-1-1-0","dir":"Changelog","previous_headings":"","what":"New features","title":"fs 1.1.0","text":"Removed autotool system dependency non-windows systems.","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"bugfixes-1-1-0","dir":"Changelog","previous_headings":"","what":"Bugfixes","title":"fs 1.1.0","text":"dir_delete() now correctly expands paths (#47). dir_delete() now correctly deletes hidden files directories (#46). link_path() now checks error trying make string, avoiding crash (#43). libuv return paths now marked UTF-8 strings C code, fixing encoding issues windows. (#42) dir_copy() now copies directory inside target target directory (#51). dir_copy() now works correctly absolute paths longer removes files overwrite = TRUE.","code":""},{"path":"https://fs.r-lib.org/dev/news/index.html","id":"fs-100","dir":"Changelog","previous_headings":"","what":"fs 1.0.0","title":"fs 1.0.0","text":"CRAN release: 2018-01-19 Removed libbsd system dependency linux Initial release Added NEWS.md file track changes package.","code":""}]