ffpath - find file path

The function finds full directory name from matlabpath or system path for the file name


Updated 2 Jan 2009

View License

The function browses very fast current directory and directories known in 'matlabpath' and the system variable 'path'. It searches for the file, name of which is in the input argument 'fname'. If a directory is found, the output argument pth is filled by a path to the file name from 'fname', otherwise pth is set empty. File names should have their extensions, but MATLAB m-files.

fname = file name
pth = path to the fname

pth = ffpath('gswin32c.exe')
% c:\Program Files\gs\gs8.60\bin\
pth = ffpath('hgrc')
% C:\PROGRA~1\MATLAB\R2006b\toolbox\local

Cite As

Miroslav Balda (2023). ffpath - find file path (https://www.mathworks.com/matlabcentral/fileexchange/22501-ffpath-find-file-path), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2006b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on File Name Construction in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

A test on presence of a file name as intut argument complemented.