Creating new databases fails on network drives if user has no privileges on underlying folder due to normalizePath
with mustWork = TRUE
#455
Labels
help wanted ❤️
we'd love your help!
Recently, in 27bba58, the R package for duckdb has been updated to normalize paths before connecting, using
normalizePath
withmustWork = TRUE
However,
normalizePath
will fail on network drives if the user does not have sufficient permissions on all underlying directories, even when the path is valid and the user can access it. This causes existing code to break with the new package version.Quoting from the docs of
normalizePath
:I can work around this by monkeypatching the package, e.g.
However, I'd rather not do any monkeypatching. After monkeypatching, everything works fine.
Note that this operation is safe in that either
file.exists(out)
isTRUE
and thusnormalizePath(out, mustWork = TRUE)
would never be called, or thatwriteLines(character(), out)
is called and thus the path must be valid (as a file can be created on that path).I'm not entirely sure why
mustWork = TRUE
was used there. I'd gladly submit a pull request changing that toFALSE
if there's no good reason for it.The text was updated successfully, but these errors were encountered: