Closed boshek closed 3 years ago
For MAC OS also you need to be connected to VPN and have the drive mounted and have an existing path, so some informative warning/error language here might help people de-bug among the possibilities.
I don't think that's necessarily the best behaviour. What if you want to do:
dir.create(use_network_path("path_that_exists/dir_that_doesnt_yet_exist"))
Or even
write.csv(x, use_network_path("path_that_exists/newfile.csv"))
So maybe it is just the message for things to double check (e.g. does the path exists, on a MAC OS is the drive mounted, are you connected to the network)?
Ah yes that is a good point. Also it looks like the read_
functions really take care of this for us anyways (and quite quickly too).
In the absence of better auto-completion abilities I think it might be useful for
use_network_path
to check if the path you are inputting actually exists. I think that could happen here:https://github.com/bcgov/safepaths/blob/1e7d84878120107b0977cc50e6d046cc3c5818bd/R/utils.R#L43
It would then throw that warning quickly so that a
read_*
function doesn't try to find a file that isn't there.