ParaMonte MATLAB 3.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation. |
Go to the source code of this file.
Functions | |
function | abs (in path, in style) |
Return the Get absolute canonical path of a file or folder. More... | |
function abs | ( | in | path, |
in | style | ||
) |
Return the Get absolute canonical path of a file or folder.
Absolute path names are safer than relative paths, e.g., when a GUI or TIMER callback changes the current directory.
Only canonical paths without "."
and ".."
can be recognized uniquely.
"\\?\"
to be handled by Windows API functions, e.g. for MATLAB intrinsic routines fopen()
, dir()
and exist()
.'\\?\'
prefix.'fat'
style is useful e.g., when MATLAB dir()
command is called for a folder with less than 260
characters, but together with the file name this limit is exceeded."dir(pm.sys.path.abs([folder, '\*.*'], 'fat'))"
helps.[in] | path | : The input argument that can be either,
The path need not exist. Unicode strings, UNC paths and long names are supported. |
[in] | style | : The optional input scalar MATLAB string or character, containing the style of the output as string. The following values are possible:
style is ignored when not running under Windows.(optional, default = 'auto') |
path
: The output scalar MATLAB character string containing the absolute path corresponding to the input path.path
is empty, pathAbs
is the current directory.'\\?\'
or '\\?\UNC'
are added on demand as requested by the optional input argument style
.
Possible calling interfaces ⛓
Example usage ⛓
Example usage ⛓
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
This file is based on a functionality originally developed by Jan Simon.
/// Copyright (c) 2016, Jan Simon /// All rights reserved. /// /// Redistribution and use in source and binary forms, with or without /// modification, are permitted provided that the following conditions are met: /// /// * Redistributions of source code must retain the above copyright notice, this /// list of conditions and the following disclaimer. /// /// * Redistributions in binary form must reproduce the above copyright notice, /// this list of conditions and the following disclaimer in the documentation /// and/or other materials provided with the distribution /// * Neither the name of nor the names of its /// contributors may be used to endorse or promote products derived from this /// software without specific prior written permission. /// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" /// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE /// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE /// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE /// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL /// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR /// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER /// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, /// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE /// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /// /// Tested: MATLAB 2009a, 2015b(32/64), 2016b, 2018b, Win7/10 /// Compiler: LCC2.4/3.8, BCC5.5, OWC1.8, MSVC2008/2010 /// Assumed Compatibility: higher MATLAB versions /// Author: Jan Simon, Heidelberg, (C) 2009-2019 matlab.2010(a)n(MINUS)simon.de /// /// $JRev: R-M V:038 Sum:C/6JMzUYsYsc Date:19-May-2019 17:25:55 $ /// $License: BSD (use/copy/change/redistribute on own risk, mention the author) $ /// $UnitTest: uTest_getFullPath $ /// $File: Tools\GLFile\pm.sys.path.abs.m $ /// History: /// 001: 20-Apr-2010 22:28, Successor of Rel2AbsPath. /// 010: 27-Jul-2008 21:59, Consider leading separator in M-version also. /// 011: 24-Jan-2011 12:11, Cell strings, '~File' under linux. /// Check of input types in the M-version. /// 015: 31-Mar-2011 10:48, BUGFIX: Accept [] as input as in the Mex version. /// Thanks to Jiro Doke, who found this bug by running the test function for /// the M-version. /// 020: 18-Oct-2011 00:57, BUGFIX: Linux version created bad results. /// Thanks to Daniel. /// 024: 10-Dec-2011 14:00, Care for long names under Windows in M-version. /// Improved the unittest function for Linux. Thanks to Paul Sexton. /// 025: 09-Aug-2012 14:00, In MEX: Paths starting with "\\" can be non-UNC. /// The former version treated "\\?\C:\<longpath>\file" as UNC path and /// replied "\\?\UNC\?\C:\<longpath>\file". /// 032: 12-Jan-2013 21:16, 'auto', 'lean' and 'fat' style. /// 038: 19-May-2019 17:25, BUGFIX, Thanks HHang Li, "File(7:..." -> "File(8:..." ///