Can't save R/RStudio scripts on OneDrive (Windows) - RStudio error

R version: 4.0.5
RStudio version: 1.4.1106
OS: Windows 10 Enterprise
Version: 20H2
OS build: 19042.746

At my work I am required to use the OneDrive, however whenever I go to modify or save a R script I get the following error message:

Error saving [File Location]: The create operation failed because the name contained at least one mount point which resolves to a volume to which the specified device object is not attached.

When saving to the local C Drive there are no issues. My colleague's on the same systems have not experienced the same issue. I my employer requires that I continue to use OneDrive.

After researching the issue the following post was found:

In the comments it was recommended to temporarily disable OneDrive syncing. When I tried this the error remains.

Are there any solutions to this issue?

Hi @SGMedia , welcome to RStudio Community. I would recommend to avoid using the OneDrive sync app, and sync your project with OneDrive via their API. In other words, make your changes locally, and then transfer the files to OneDrive on a regularly frequent basis. There is a package that may be able to help you create a simple transfer script, I have not used it, but it looks promising: GitHub - Azure/Microsoft365R: R SDK for interacting with Microsoft 365 APIs

1 Like

HI @edgararuiz, thank you for your reply.

I would unfortunately be required to use the sync app in order for other team members to be able to use what I am working on in a relatively instantaneously basis. I have implemented your suggestion and it does make my scripts accessible on the OneDrive which has been a real help, but it didn't explain the original cause of the issue.

Are there any further recommendations on how I can continue to use the sync app or any explanations that may cause the issue in the first place?

Are your other team members accessing results from your analysis, or your source code? If analysis, then I would recommend syncing just the sub folder that contains the results. If the source code, I would recommend using Git, do you have access to GitHub or Azure DevOps?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.