New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
mread() can't find project directory when working on a mapped network drive #1100
Comments
Thanks for the detailed bug report.
I don't have an answer for "why", but it seems it's a known issue that
Another approach for consideration: rework the code to just go ahead and access the directory, catching errors to give more helpful or tailored messages where needed. What do you think @kylebaron? |
Thank you for your answer @kyleam. Indeed, it seems that I am not the only one having issues with Just to prove that this would be a valid solution I have modified
and replaced the stop with a warning. Now I am able to read in the model file also from mapped / mounted network drives:
In my opinion such a warning message would be sufficient to give a hint to user where to look in case the directory is actually non-existent or non-readable. I have created a pull-request #1101 in case you think this solution is sufficient. |
Hi - I'm happy to work on this with you but please note:
I think we can write a Windows-mapped-network-drive safe version of file access following the pattern in the R source. @marianklose When this is ready to go, can you please test it for us? Thanks, |
Hi @kylebaron, thank you for your insights. To reply to your discussion points:
I have checked it on 2 other machines with networked drives to our university network and was able to reproduce the issue.
Sure, I am happy to test it! Thanks for your help, |
Hi, thanks a lot for the great work! 馃憤
I am having trouble with reading in model files when working on a mapped network drive. When working remotely we usually connect to the university network (e.g. \\campus.fu-berlin.de\daten...) via mapping it to a network drive (G://). It's hard to provide a reproducible example but here is the behaviour in a nutshell.
To make sure that we are already in the model directory I run:
Now there is a file in our working directory called goti2018.cpp which is accessible via e.g., readLines()
However, mread() throws an error:
This is the traceback:
Inside new_build() which gets called by mread we have
which apparently causes the error. The project argument should be the default argument from mread which is
project = getOption("mrgsolve.project", getwd())
and which is in our case "G:/Projekte/xxx/models". The definition of file_readable() from utils.R isSince file_readable isn't being exported I directly use file.access to check the behaviour:
The project is existent as
file.access("G:/Projekte/xxx/models", 0)
is TRUE. If I copy the full folder over to my Desktop both mread() and file access work without problems.I wonder why file.access() indicates that there are no read permissions on the mapped network drive altough the directory is clearly readable. Would it be possible to maybe include an option in mread whether to check for read permissions or to skip that check? I am sure that in my case there wouldn't be any read issues and that the error is related to some misbehaviour of file.access().
Thank you!
The text was updated successfully, but these errors were encountered: