metrumresearchgroup / mrgsolve

Simulate from ODE-based population PK/PD and QSP models in R
https://mrgsolve.org
GNU General Public License v2.0
132 stars 36 forks source link

Fixing false file.access() errors on windows machines #1101

Closed marianklose closed 1 year ago

marianklose commented 1 year ago

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 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.

kylebaron commented 1 year ago

@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.

Kyle