About Site Map Submit Contact Us Log in | Create an account
Create an account Log In
Average Rating
User Rating:
Visitors Rating:
My rating:

Write review
See full specifications

scripts default iconGetFullPath (Scripts) Publisher's description

GetFullPath - Get absolute path of a file or folder name

GetFullPath - Get absolute path of a file or folder name

This function converts a partial or relative name to an absolute full path name. The fast Mex works on Windows only (sorry), but the M-file runs on Windows, MacOS and Unix.

FullName = GetFullPath(Name)
Name: String or cell string, file or folder name with relative or absolute path.
FullName: String or cell string, file or folder name with absolute path.
The created path need not exist.

cd(tempdir); % Assuming C:Temp here
GetFullPath('File.Ext') % ==> 'C:TempFile.Ext'
GetFullPath('..File.Ext') % ==> 'C:File.Ext'
GetFullPath('....File.Ext') % ==> 'C:File.Ext'
GetFullPath('.File.Ext') % ==> 'C:TempFile.Ext'
GetFullPath('*.txt') % ==> 'C:Temp*.txt'
GetFullPath('D:Folder1..Folder2') % ==> 'D:Folder2'
GetFullPath('..') % ==> 'C:'
GetFullPath('') % ==> 'C:', current drive!
GetFullPath('Folder') % ==> 'C:TempFolder'
% ==> '\ServerFolderFile.ext'

See also (timings converted with GetFullPath):
WHICH: only for existing files, ~24 times slower.
System.IO.FileInfo: .NET (thanks Urs), more features, ~50 times slower.
java.io.File: "/.." and "/." are fixed by getCanonicalPath (~6 times slower),
but no completing of partial/relative path.

Tested: Matlab 6.5, 2008a, 2009a, 2001b, WinXP/32, Win7/64
Compiler: LCC 2.4/3.8, OpenWatcom 1.8, BCC 5.5, MSVC 2008/2010
Precompiled Mex: http://www.n-simon.de

Suggestions and question by email or in the comment section are very welcome - especially a test under Linux and MacOS.

System Requirements:

MATLAB 7.8 (R2009a)
Program Release Status: Major Update
Program Install Support: Install and Uninstall

GetFullPath (Scripts) Tags:

Click on a tag to find related softwares

Is GetFullPath (Scripts) your software?

Manage your software

Most Popular

scripts default icon ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation 1.1
ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation contain several functions for digital modulation simulation
scripts default icon Simulink Communication Labs 1.1
Simulink Communication Labs allows you to learn communication systems in greater depth.
scripts default icon M-QAM modulation and demodulation 1.1
M-QAM modulation and demodulation is the QAM modulation and demodulation tech.
scripts default icon LZW Compression/Decompression 1.1
LZW Compression/Decompression - Updated LZW compressor and decompressor with reasonable performance
scripts default icon InSPIRE utility to plot a 2D displacement field (Scripts) 1.0
This program plots the deformation field (displace vectors) contained in vector.txt.