Displaying 2 results from an estimated 2 matches for "_intentionally_".
2020 Feb 26
3
unlink() on "~" removes the home directory
..., and you iterate over all files and directories
to selectively remove some of them, then your code might end up
calling unlink on the local "~" directory, and then your home is gone.
But you would not create a directory named "~", that is just asking
for trouble. Well, surely, _intentionally_ you would not do that.
Unintentionally, you might. E.g. something like this is enough:
# Create a subpath within a base directory
badfun <- function(base = ".", path) {
dir.create(file.path(base, path), recursive = TRUE, showWarnings = FALSE)
}
badfun(path = "~/foo")
(If...
2020 Mar 23
0
unlink() on "~" removes the home directory
...ll files and directories
> to selectively remove some of them, then your code might end up
> calling unlink on the local "~" directory, and then your home is gone.
>
> But you would not create a directory named "~", that is just asking
> for trouble. Well, surely, _intentionally_ you would not do that.
> Unintentionally, you might. E.g. something like this is enough:
>
> # Create a subpath within a base directory
> badfun <- function(base = ".", path) {
> dir.create(file.path(base, path), recursive = TRUE, showWarnings = FALSE)
> }
> bad...