How to add network drive to path

In Octave on Win10 I can add the location of an already mounted network drive as follows:

addpath("//NetName/folder/libfolder");

The location is then included in the path variable, and I can access functions in libfolder.

I’ve not been able to get this to work in Octave on Linux, despite trying several different syntax. For example

“//NetName/folder/libfolder”
“smb://NetName/folder/libfolder”
“\\NetName\folder\libfolder”
“smb:\\NetName\folder\libfolder”

Could someone provide an example syntax to add a network drive in Linux please.

Thanks

Win10 Octave 6.2, Mint 20.1 Cinamon Octave 5.2, Mint 20.1 Cinamon Octave 6.2 (Flatpak)

I am not sure if there is an easier way, but you can mount the network drive with your file explorer and then add the mount point to the path.

Thanks for the reply. Your suggestion is exactly what I was trying to do, but is not working.

I think there are a couple of issues going on.

Firstly/ Mounting through the File explorer (Nemo) does not appear to create a conventional mount point, but a temporary file system (tmpfs) instead. I should add this is mostly beyond my pay grade, I just want it to work.

The location given by the File Explorer is:

[1] smb://diskstation.local/generalshare/Octave

But it appears in the file system as:

[2] /run/user/1000/gvfs/smb-share:server=diskstation.local,share=generalshare/Octave

And mount shows it as tmpfs.

Using Octave 5.2 (native) I can navigate to [2] through the Octave 5.2 File Browser pane, but not [1]. However addpath fails with [1] & [2]. Perhaps due to syntax checking.

addpath("/run/user/1000/gvfs/smb-share:server=diskstation.local,share=generalshare/Octave")
warning: addpath: server=diskstation.local,share=generalshare/Octave: No such file or directory
warning: addpath: /run/user/1000/gvfs/smb-share: No such file or directory

Secondly/ Using Octave 6.2 (flatpak) I cannot navigate to the location at all using [1] or [2]. I presume the flatpak environment does not support tmpfs, perhaps someone can confirm that.

I assume only a conventional mount is going to work, but I didn’t want to do that if I could avoid it.

If anyone has a cheaper work around I’d be glad to hear it.

Thanks

Looks like the colon ‘:’ in the path is the problem. You can create a symbolic link and add the link to the path:

>> symlink ('/run/user/1000/gvfs/smb-share:server=diskstation.local,share=generalshare/Octave', 'my_octave_share')
>> addpath ('~/my_octave_share')

Yes thank you.

Does not work on Octave 6.2 (flatpak) which is my target, perhaps re my comment on flatpak and tmpfs.

It does though work on Octave 5.2 (native), and that is useful. Thanks.

Flatpak applications are strictly sandboxed by default, but you can override as much or as little of that as you want. Check out the Flatpak sandbox permissions and options. Specifically, the --filesystem= option should let you share directories or mount points into a Flatpak application.

In case it wasn’t clear, the --filesystem= option can be used as many times as you want, on either the flatpak run command one time, or using flatpak override to make it a permanent setting.

Thanks (again). I’ll go check that out.

Thanks