Adding external drives to path

15 views (last 30 days)
Alexandra Ferguson
Alexandra Ferguson on 12 May 2019
Commented: Neil Donahue on 30 Sep 2019
I'm trying to add external volumes to my path using a startup file (using a MAC). When I try to do this, either with Google Drive File Stream (technically an external drive) using the following code:
addpath('/Volumes/GoogleDrive/MyDrive/');
Or with an external hard drive
addpath('/Volumes/USBDrive/this folder');
I get the following error:
Warning: Name is nonexistent or not a
directory: /Volumes/GoogleDrive/MyDrive/
Adding other paths works fine in this file. It also doesn't work when I try to run this command in the command window. The only way to add to path is to right click on the folders and choose add to path. It is happening on every release I try.
  4 Comments
Walter Roberson
Walter Roberson on 12 May 2019
Edited: Walter Roberson on 12 May 2019
Ah, I do not use Google Drive File Stream; I have the Backup and Sync version configured, which no longer provides a /volumes/GoogleDrive
Neil Donahue
Neil Donahue on 30 Sep 2019
I also have difficulty with Google Drive File Stream. I am running R2019a on macOS 10.14.6.
I have work including matlab code on Google Drive and have the file stream synched (offline access). On some occastions I get the following error when launching matlab:
Local startup stuff
Warning: Executing startup failed in matlabrc.
This indicates a potentially serious problem in your MATLAB setup, which should
be resolved as soon as possible. Error detected was:
MATLAB:UndefinedFunction
Undefined function 'whereThingsAreAerosolDynamics' for input arguments of type
'char'.
The function whereThingsAreAerosolDynamics.m is a startup function that gets executed as part of the startup in my ~/matlab/startup.m. I typically launch matlab from the command line in a directory where I want to work - in this case that "run directory" is also on Google Drive:
Donahue-Molly:001_static_loss nmd$ pwd
/Volumes/GoogleDrive/My Drive/Work/VBS/Microphysics/0t_03_Deposition/001_static_loss
ls //Volumes/GoogleDrive/My\ Drive/Work/VBS/Microphysics/aerosolDynamicsPkg/whereThingsAreAerosolDynamics.m
//Volumes/GoogleDrive/My Drive/Work/VBS/Microphysics/aerosolDynamicsPkg/whereThingsAreAerosolDynamics.m
The bottom of my path has:
/Volumes/GoogleDrive/My Drive/Work/VBS/Microphysics/aerosolDynamicsPkg
I do not believe that the annoying space in My Drive is the problem, as the misbehavior is strangely intermittent. My guess is that the caching associated with the file stream is not playing well with matlab in some way. I also have this problem on an older mac that is running 10.13 and does not have offline access because it does not appear to exist for the older OS version.
If I actually launch matlab in the aerosolDynamicsPkg directory, it does manage to find ./whereThingsAreAerosolDynamics.m and I can then navigate over to where I want to work, but that is a horrible kluge.
Help?

Sign in to comment.

Answers (0)

Categories

Find more on Search Path in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!