younger

版本 1.0.0.0 (2.2 KB) 作者: Peder Axensten
Check to see if fname has an older modification date than fname1, fname2, ...
2.2K 次下载
更新时间 2007/9/10

查看许可证

USAGE: boolean= younger(fname, fname1, fname2, ...)

Check to see if fname has an older modification date than fname1, fname2, ...

Returns true if at least one of the files fname1, fname2 etc. has a more recent modification date than fname. Returns false otherwise.

If you find any errors, please let me know! (peder at axensten dot se)

fname: Path (string) to file that might need to be updated.

fnameN: String, or cell array of strings, containing file path(s) to files that fname depends upon. If any of these has a modification date that is not older than fname's, then fname needs to be updated. If it is 'checkcallers', the modification dates of all functions in the calling chain are checked too.

EXAMPLE:
if(younger(resultfile, indatafile, which('butchread.m'), 'checkcallers')) result= do_time_consuming_stuff(indatafile, data); save(resultfile 'result');
else result= load(resultfile, 'result');
end

NOTE: If fname (or all fnameN) doesn't exist, younger returns false.

HISTORY:
Version 1.0, 2006-04-19.
Version 1.1, 2006-07-17:
- Now returns true or false, not a (often empty) list of files.
Version 1.2, 2006-11-03:
- Show a much better example.
Version 1.2, 2007-09-09:
- A new option, 'checkcallers'. I present, the modification dates of all callers in the calling chain are checked too.

Copyright (C) Peder Axensten (peder at axensten dot se), 2006.

引用格式

Peder Axensten (2024). younger (https://www.mathworks.com/matlabcentral/fileexchange/10793-younger), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R14SP1
兼容任何版本
平台兼容性
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

A new option, 'checkcallers'. I present, the modification dates of all callers in the calling chain are checked too.