fileparts2(file)

Version 1.0.0.0 (807 Bytes) by Erik Roberts
fileparts without missing trailing slash bug
28 Downloads
Updated 20 Mar 2017

View License

% Purpose: Fixes mixing trailing slash bug in fileparts. If path is a dir without
% a trailing slash, will add the slash so fileparts gives expected pathstr.
%
% Usage: [pathstr, name, ext] = fileparts2(file)
%
% Explanation:
% Given a directory structure: ./parent/child/
%
% Problem:
% fileparts(parent/child/) = parent/child % Expected
% fileparts(parent/child) = parent % Bug
%
% Solution:
% fileparts2(parent/child/) = parent/child % Expected
% fileparts2(parent/child) = parent/child % Fixed bug
%
% See also FILEPARTS

Cite As

Erik Roberts (2024). fileparts2(file) (https://www.mathworks.com/matlabcentral/fileexchange/62155-fileparts2-file), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2017a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Instrument Control Toolbox in Help Center and MATLAB Answers
Tags Add Tags

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.0.0.0