Code covered by the BSD License  

Highlights from

Be the first to rate this file! 1 Download (last 30 days) File Size: 3.1 KB File ID: #30395 Version: 1.0



Jan Simon (view profile)


Get real upper/lower case of a file or folder name

| Watch this File

File Information

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

FileName = FileRealCase(FileName)
  FileName: String, absolute path of an existing file or folder.
            UNC paths are accepted.
  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\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.

MATLAB release MATLAB 7.8 (R2009a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.

Contact us