Find free file-name

버전 1.0.0.0 (1.88 KB) 작성자: Miroslav Balda
The function searches a free name in required directory.
다운로드 수: 2.5K
업데이트 날짜: 2005/11/16

라이선스 보기

편집자 메모: This file was a File Exchange Pick of the Week

The function finds first unused name of a file in a required directory. The final name of the file consists of a name base appended by n digits (possibly with leading zeros) expressing an order of the new file possessing the same name base. The function is good for generating names of files containing results of an alternative processing of the same data.

Forms of calls:
~~~~~~~~~~~~~~
filename = freename(dirname,base);
% dirname = name of the directory, where to find a new name
% base = base of the new name (without extension)
filename = freename(dirname,base,n);
% n = number of figures to be appended (3 is default)
% filename = free name equals a base appended by 'n' figure characters

Examples:
~~~~~~~~
filename =[freename('Results','meas',2) '.txt'];
The name 'meas01.txt' will be sent to filename if there is no file
of the same base name 'meas' present in the subdirectory 'Results'.
The name 'meas04.txt' is returned provided 'meas03' exists in the
subdirectory 'Results'.
file = [freename('./', 'data') '.dat'];
returns 'data001.dat' if no file file with the base name 'data'
exists in the current directory.

인용 양식

Miroslav Balda (2024). Find free file-name (https://www.mathworks.com/matlabcentral/fileexchange/9036-find-free-file-name), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R14
모든 릴리스와 호환
플랫폼 호환성
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

Improving description