FileRealCase

버전 1.0.0.0 (3.1 KB) 작성자: Jan
Get real upper/lower case of a file or folder name
다운로드 수: 297
업데이트 날짜: 2011/2/13

라이선스 보기

Get correct case of file or folder by repeated calls of DIR

FileName = FileRealCase(FileName)
INPUT:
FileName: String, absolute path of an existing file or folder.
UNC paths are accepted.
OUTPUT:
FileName: String, absolute path with upper/lower case as set in the file system.

Matlab remembers the path as accessed in under Windows:
pathname = upper(fileparts(which('plot.m')));
% >> C:\PROGRAMME\MATLAB651\TOOLBOX\MATLAB\GRAPH2D
cd(pathname)
which('plot.m')
% >> C:\PROGRAMME\MATLAB651\TOOLBOX\MATLAB\GRAPH2D\plot.m
FileRealCase(which('plot.m'))
% >> C:\Programme\Matlab651\toolbox\matlab\graph2d\plot.m

I assume, this function is useful under Windows only, but it considers the Unix naming scheme also.

Matlab's WHICH can find the correct case of files inside the Matlab path also. But this fails for files in the current folder, if the folder was selected using a string with wrong case.

인용 양식

Jan (2024). FileRealCase (https://www.mathworks.com/matlabcentral/fileexchange/30395-filerealcase), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2009a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 File Operations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.0