existvolume

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - File handling
Introduced first in SolidGeometry 5.1, Creation date: 2021-02-26, Last change: 2025-09-15

returns the full path of a volume's diretory if this volume exists i.e. it is mounted

Description

if a cell list of volume names is used, the first exisiting volume directory is returned

See Also:

Example Illustration

 missing image of existvolume(vname)

Syntax

dname=existvolume([vname])

Input Parameter

vname: volume title

Output Parameter

dname: matlab path to volume dir; ends always with filesep

Examples


existvolume('PLATTE LUETH ALL')
existvolume({'PLATTE LUETH ALL2','PLATTE LUETH ALL4','PLATTE LUETH ALL'})




Copyright 2021-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

This function, existvolume, is designed to check if a specified volume is mounted on a system running macOS. It returns the full path to the volume's directory if it exists.

Input Parameters

Output

Algorithm Steps

  1. The function starts by retrieving the volume name using getfuncparams. If no volume name is provided, it defaults to 'PLATTE LUETH ALL'.
  2. If vname is a cell array, the function iterates over each volume name in the array:
  3. If vname is not a cell array, the function checks if the operating system is macOS:
  4. It constructs the directory path by appending the volume name to '/Volumes/'.
  5. It ensures the path ends with a file separator.
  6. It checks if the directory exists using exist:

Example Usage

Algorithm explaination created using ChatGPT on 2025-08-19 01:13. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21