fs | base | shell |
---|---|---|
dir_ls("/path") |
list.files("/path") |
ls /path |
dir_info("/path") |
do.call(rbind, lapply(list.files("/path"), file.info)) |
ls -al /path |
dir_copy("/path", "/new-path") |
dir.create("/new-path"); file.copy("/path", "/new-path", recursive=TRUE) |
cp /path /new-path |
dir_create("/path") |
dir.create("/path") |
mkdir /path |
dir_delete("/path") |
unlink("/path", recursive = TRUE) |
rm -rf /path |
dir_exists("/path") |
dir.exists("/path") |
if [ -d "/path" ]; then ... ; fi |
dir_move() file_move !) |
file.rename("/path", "/new-path") |
mv /path /new-path |
fs | base | shell |
---|---|---|
file_chmod("/path", "mode") |
No easy way | chmod mode /path |
file_chown("path", "user_id", "group_id") |
No easy way | chown options /path |
file_copy("/path", "/new-path") |
file.copy("/path", "/new-path") |
cp /path /new-path |
file_create("/new-path") |
file.create("/new-path") |
touch /new-path |
file_delete("/path") |
unlink("/path") |
rm /path |
file_exists("/path") |
file.exists("/path") |
if [ -f "/path" ]; then ... ; fi |
file_info("/path") |
file.info("/path") |
ls -al /path |
file_move("/path", "/new-path") |
file.rename("/path", "/new-path") |
mv /path /new-path |
file_show("/path") |
browseURL("path") |
open /path |
file_temp |
TODO | TODO |
file_touch() (doesn't create file) |
TODO | TODO |
fs | base | shell |
---|---|---|
path("top_dir", "nested_dir", "file", ext = "ext") |
file.path("top_dir", "nested_dir", "file.ext") |
top_dir/nested_dir/file.ext |
path_expand("~/path") |
path.expand() |
Need scripting. |
path_dir("/path") |
dirname("/path") |
dirname /path |
path_file("/path") |
basename("/path") |
basename /path |
path_home() |
path.expand("~") |
$HOME |
path_ext_remove("/path") |
sub("\\.[a-zA-Z0-9]*$", "", "/path") |
Need scripting. |
path_ext_set("/path", "new_ext") |
sub("\\.[a-zA-Z0-9]*$", "new_ext", "/path") |
Need scripting. |
As discussed, I think there is some difference on windows and Linux / MAC. Maybe this should be taken into account.
I know this one :
Created on 2019-01-21 by the reprex package (v0.2.1)
I'll be happy to test on windows the table.