I've provided a little bugfix for windows machines where file.access() falsely indicates readability issues. This can happen e.g., when working on mounted / mapped network drives. Please refer to issue #1100.
Why?
The new_build() function checks via file_readable() (helper function for file.access()) if the directory is readable. file.access() however seems to be unreliable and throws errors even when the directory is readable. Thus, it is not justified to force a stop based on output from file.access().
How?
Minor change: changed the stop into a warning. Instead of forcing a stop, the user will be informed that the directory might be non-readable or non-existent.
Testing
Tested the modified function on my local machine when working on a mapped network drive and now the model is correctly being read in plus throws a warning
Warning message:
The file.access function indicates that project directory 'G:/Projekte/xxx/models' might not exist or is not readable. However, file.access is unreliable on Windows. Thus, existance and readability of the project directory should be ensured by the user.
The change is not expected to affect any of the existing tests. devtools::check() passes without issues.
@marianklose -
Thanks for proposing the PR, but we won't be addressing the issue this way. Could you please close this and we'll be in touch to test the fix on your system.
What?
I've provided a little bugfix for windows machines where
file.access()
falsely indicates readability issues. This can happen e.g., when working on mounted / mapped network drives. Please refer to issue #1100.Why?
The
new_build()
function checks viafile_readable()
(helper function forfile.access()
) if the directory is readable.file.access()
however seems to be unreliable and throws errors even when the directory is readable. Thus, it is not justified to force a stop based on output fromfile.access()
.How?
Minor change: changed the stop into a warning. Instead of forcing a stop, the user will be informed that the directory might be non-readable or non-existent.
Testing
Tested the modified function on my local machine when working on a mapped network drive and now the model is correctly being read in plus throws a warning
The change is not expected to affect any of the existing tests. devtools::check() passes without issues.