UnmountMedia Method
Unmounts media from the virtual drive.
Syntax
cbfs.unmountMedia(forceUnmount, [callback])
Callback
The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).
The callback for this method is defined as:
function(err){ }
'err' is the error that occurred. If there was no error, then 'err' is 'null'.
'err' has 2 properties which hold detailed information:
err.code err.message
Remarks
This method unmounts the virtual storage media from the virtual drive. The virtual drive itself, as well as any existing mounting points, remain present.
If ForceUnmount is true, all open files are forcefully closed. If ForceUnmount is false and open files or directories are detected, this method throws an exception.
This method must not be called for plug-and-play virtual drives with non-removable media (see StorageType); attempting to do so will cause the call will fail with an "access denied" error.
Note: This method can only be called after creating a virtual drive, and cannot be called within events.