fileparts2(file)
% 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
引用
Erik Roberts (2024). fileparts2(file) (https://www.mathworks.com/matlabcentral/fileexchange/62155-fileparts2-file), MATLAB Central File Exchange. 取得済み .
MATLAB リリースの互換性
プラットフォームの互換性
Windows macOS Linuxカテゴリ
タグ
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!バージョン | 公開済み | リリース ノート | |
---|---|---|---|
1.0.0.0 |