gettime_jd

PURPOSE ^

SYNOPSIS ^

function filetime = gettime_jd(filename,filepath,test)

DESCRIPTION ^

 This function returns a comparison-ready modification time for the input
 file in the input directory

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function filetime = gettime_jd(filename,filepath,test)
0002 %
0003 % This function returns a comparison-ready modification time for the input
0004 % file in the input directory
0005 %
0006 if nargin < 3,
0007     test = false;
0008 end
0009 %
0010 if nargin < 2 || isempty(filepath),
0011     filepath = './';
0012 end
0013 %
0014 files = dir(filepath);
0015 filetime = 0;
0016 %
0017 for ifile = 1:length(files),
0018     if strcmp(files(ifile).name,filename),
0019         if isfield(files(ifile),'datenum'),
0020             filetime = files(ifile).datenum;
0021         else
0022             filetime = datenum(files(ifile).date);
0023         end
0024         return
0025     end
0026 end
0027 %
0028 if test,
0029     error(['The source file ',filename,' was not found in ',filepath])
0030 end

Community support and wiki are available on Redmine. Last update: 18-Apr-2019.