NetFSMountMBS format for NAS

Hi,

I’m trying to mount shares from a NAS using the NetFSMountMBS class. Whatever I try, I get errors.

Currently, this is my code:

Var MountPoints() as string
Var Result as integer=app.NFSM.MountURLSync("smb://192.168.1.117","Movies",UserName,Password,app.OpenOptions,app.MountOptions,MountPoints)

(app.NFSM being a property of type NetFSMountMBS)

The dictionaries are built as follow:

MountOptions=new Dictionary
MountOptions.Value(NetFSMountMBS.kNetFSAllowSubMountsKey)=true

OpenOptions=new Dictionary
OpenOptions.Value(NetFSMountMBS.kNAUIOptionKey)=NetFSMountMBS.kNAUIOptionNoUI

Result always equals -6003 and MountPoints is nil.
-6003, from the MBS documentation is “No shared available.”. Is that intended to be “No shares available”?

With “smb://192.168.1.117.local”, it’s worse, as the server can’t even be found, and it doesn’t work without “smb://” either.
I get the same behaviours using the example project.

I can’t find the requested format.
Can anyone help me?

Your URL misses the name of the volume you like to mount.
And maybe pass “” for the mount path to let it pick the default one.

1 Like

I thought the mount path was the volume name.

If the volume name is to be passed in the URL, what can mount path be used for?

Thank you.

Well, it’s the destination on your computer.

e.g. “/Volumes/test”

Ah, ok, thanks.
So, if I pass an empty string to the mount path, what does the “default path” mean in this context? The root folder?

P.S.: your solution of passing the volume inside the URL indeed works, thank you.

Empty mount path → default location

Yes, I get it, but what’s the “default location” inside a shared volume?

It’s the path on your computer, where you want the share to appear.

Default is “/Volumes/Movies” for you.

So, to summarise, with my first example:
The URL is: smb.//192.168.1.117/Movies (i.e. the volume/share “Movies” on my NAS).
The default share, when passing “” as Mount Path is /volumes/movie (or the equivalent for my NAS).
Correct until here?

So, if I pass “smb://192.168.1.117/Movies” as the URL and “MyFolder” as Mount Path, it’d try to mount “/volumes/Movies/MyFolder” on my NAS or “/volumes/MyFolder”?

In my mind, a share and a Mount Path are the same.

Thanks.

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.