Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

MountMBS(URL as String, Dest as string = "", Username as String, Password as String, Interactive as boolean = false, Prompt as boolean = false, byref ErrorCode as Integer, Threaded as boolean = false) as String
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method Files MBS MacOSX Plugin 18.3 Yes Yes Yes Yes No
Function: Mounts a network share.
Notes:
Use on Server may require extra work as server runs with a different user account than you being logged in on the server machine. Permissions don't always allow things to be done.

URL: The URL for the network resource.
Dest: The destination path to mount to. If you leave this empty, the system decides. On Mac this can be the path to a folder where to mount new disk inside, e.g. to make a private mount. For Linux destination is required and must exists.
Username: The user name. If none is provided, system can take credentials from keychain, e.g. "test"
Password: The password to use, e.g. "test"
Interactive: Default is false for no dialogs. But you can pass true to have a dialog show up.
Prompt: Pass true on Windows to show dialog always to enter password.

When used on Linux the parameters are a little bit different:
Please pass source (URL), target (Dest), type (Username) and data (Password).
The dest path may need to be created first as new folder.

Returns the new path to the mounted disk.

Examples for URLs:

"afp://Ablage1.local" to mount on Mac via Apple Filesharing Protocol.
"\\myServer\public" to mount a disk on Windows.
"afp://192.168.168.250/Customer%20Data" to mount disk with space in name (URL encoded).
"\\192.168.0.242\ERP" mounts from Windows Server and e.g. pass "SRV2012\bob" as user name.

Threaded: If true and run on a Xojo thread, we yield time to other thread.

Some examples using this method:

Feedback, Comments & Corrections

MountPathMBS(Path as String) as String
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method Files MBS MacOSX Plugin 18.3 Yes Yes No Yes No
Function: Queries mount path for a volume.
Example:
MsgBox MountPathMBS("/Volumes/Ablage2")
Notes:
For a network mounted disk, you can query the original mount point.
May not work on Mac for AFP shares, but for SMB shares.
Returns empty path if no path is known.

See also:

Feedback, Comments & Corrections

MountPathMBS(Volume as FolderItem) as String
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method Files MBS MacOSX Plugin 18.3 Yes Yes No Yes No
Function: Queries mount path for a volume.
Example:
dim f as FolderItem = Volume(VolumeCount-1)

MsgBox MountPathMBS(f)
Notes:
For a network mounted disk, you can query the original mount point.
May not work on Mac for AFP shares, but for SMB shares.
Returns empty path if no path is known.

See also:

Feedback, Comments & Corrections

UnmountMBS(Path as String, force as boolean = false) as Boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method Files MBS MacOSX Plugin 18.3 Yes Yes Yes Yes No
Function: Unmount a volume.
Notes:
Path: The local path of the volume, e.g. "/Volumes/Test"
Force: Pass true to force unmount, even if files are still open.

Use on Server may require extra work as server runs with a different user account than you being logged in on the server machine. Permissions don't always allow things to be done.

See also:

Some examples using this method:

Feedback, Comments & Corrections

UnmountMBS(Volume as FolderItem, force as boolean = false) as Boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method Files MBS MacOSX Plugin 18.3 Yes Yes Yes Yes No
Function: Unmount a volume.
Notes:
Path: The local path of the volume, e.g. "/Volumes/Test"
Force: Pass true to force unmount, even if files are still open.

Use on Server may require extra work as server runs with a different user account than you being logged in on the server machine. Permissions don't always allow things to be done.

See also:

Some examples using this method:

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS MacOSX Plugin.





Links
MBS Xojo Chart Plugins