Be the first to rate this file! 110 downloads (last 30 days) File Size: 3.17 KB File ID: #10793

younger

by Peder Axensten

 

19 Apr 2006 (Updated 10 Sep 2007)

Code covered by BSD License  

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

Download Now | Watch this File

File Information
Description

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.

MATLAB release MATLAB 7.0.1 (R14SP1)
Other requirements Probably works on older versions too.
Zip File Content  
Other Files license.txt,
younger.m
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
15 Jun 2006

DEPRECATED: Check out 'waitbar alternative' instead:
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=11398

20 Jul 2006

Now returns true or false, not a (often empty) list of files.

10 Sep 2007

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

Tag Activity for this File
Tag Applied By Date/Time
path Peder Axensten 22 Oct 2008 08:22:38
directories Peder Axensten 22 Oct 2008 08:22:38
files Peder Axensten 22 Oct 2008 08:22:38
update Peder Axensten 22 Oct 2008 08:22:38
file date Peder Axensten 22 Oct 2008 08:22:38
changed Peder Axensten 22 Oct 2008 08:22:38
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com