Show ``count`` most-recently modified files by mtime

        Yields:
            tuple: (strftime-formatted mtime, self.fpath-relative file path)
518250
def lately(self, count=15):
        
        excludes = '|'.join(('*.pyc', '*.swp', '*.bak', '*~'))
        cmd = ('''find . -printf "%%T@ %%p\\n" '''
               '''| egrep -v '%s' '''
               '''| sort -n '''
               '''| tail -n %d''') % (excludes, count)
        op = self.sh(cmd, shell=True)
        for l in op.split('\n'):
            l = l.strip()
            if not l:
                continue
            mtime, fname = l.split(' ', 1)
            mtime = datetime.datetime.fromtimestamp(float(mtime))
            mtimestr = dtformat(mtime)
            yield mtimestr, fname
1305112
def touch(path, times=None):
  
  if times:
    if len(times) > 2:
      raise ValueError('times must either be a tuple of (atime, mtime) or else a single time value '
                       'to use for both.')

    if len(times) == 1:
      times = (times, times)

  with safe_open(path, 'a'):
    os.utime(path, times)
303788
def last_updated(self):
        '''
        
        '''
        derived_path = self.context.request.url
        timestamp_key = self.timestamp_key_for(derived_path)

        if self.exists(self.timestamp_key_for, derived_path):
            return self.storage.get(timestamp_key)

        return None
1179862
def changed_path(self):
        ""
        result = None  # default
        for path in self.paths_to_modification_times:
            lastmod = self.paths_to_modification_times[path]
            mod = os.path.getmtime(path)
            if mod > lastmod:
                result = "Watch file has been modified: " + repr(path)
            self.paths_to_modification_times[path] = mod
        for folder in self.folder_paths:
            for filename in os.listdir(folder):
                subpath = os.path.join(folder, filename)
                if os.path.isfile(subpath) and subpath not in self.paths_to_modification_times:
                    result = "New file in watched folder: " + repr(subpath)
                    self.add(subpath)
        if self.check_python_modules:
            # refresh the modules
            self.add_all_modules()
        if self.check_javascript:
            self.watch_javascript()
        return result
315457
def _get_timestamp(self):
        """"""
        filename_date = _find_date(os.path.basename(self._path))
        if filename_date:
            return filename_date
344547
def __is_current(filepath):
    ''''''
    if not __DOWNLOAD_PARAMS['auto_update']:
        return True

    if not os.path.isfile(filepath):
        return False

    return datetime.datetime.utcfromtimestamp(os.path.getmtime(filepath)) \
        > __get_last_update_time()
1278912
def listrecursive(path, ext=None):
    
    filenames = set()
    for root, dirs, files in os.walk(path):
        if ext:
            if ext == 'tif' or ext == 'tiff':
                tmp = fnmatch.filter(files, '*.' + 'tiff')
                files = tmp + fnmatch.filter(files, '*.' + 'tif')
            else:
                files = fnmatch.filter(files, '*.' + ext)
        for filename in files:
            filenames.add(os.path.join(root, filename))
    filenames = list(filenames)
    filenames.sort()
    return sorted(filenames)
1095876
def get_days_since_last_modified(filename):
        
        now = datetime.now()
        last_modified = datetime.fromtimestamp(os.path.getmtime(filename))
        return (now - last_modified).days
662761
function getDirContentMTime(dirPath, ignoredDirs, ignoredFiles){
    let mtime
    if(fs.existsSync(dirPath)){
        _ignoredDirs.push.apply(_ignoredDirs, ignoredDirs)
        _ignoredFiles.push.apply(_ignoredFiles, ignoredFiles)
        mtime = recursiveGetDirContentMTime(dirPath)
    }
    return mtime
}
266814
def module_getmtime(filename):
    
    if os.path.splitext(filename)[1].lower() in (".pyc", ".pyo") and os.path.exists(filename[:-1]):
        return os.path.getmtime(filename[:-1])
    if os.path.exists(filename):
        return os.path.getmtime(filename)
    return None
113802
def watch_file(path, func, *args, **kwargs):
    
    if not path:
        raise ValueError('Please specify a file to watch')
    print('Watching "{}" for changes'.format(path))
    last_modification_time = os.path.getmtime(path)
    try:
        while True:
            time.sleep(1)
            new_modification_time = os.path.getmtime(path)
            if new_modification_time == last_modification_time:
                continue
            func(*args, **kwargs)
            last_modification_time = new_modification_time
    except KeyboardInterrupt:
        pass
867779
def read_trip_counts_by_date(path: str) -> Dict[datetime.date, int]:
    """"""
    feed = load_raw_feed(path)
    return _trip_counts_by_date(feed)
654149
def access_time(self):
    """"""
    timestamp = self._fsntfs_attribute.get_access_time_as_integer()
    return dfdatetime_filetime.Filetime(timestamp=timestamp)
369487
def _is_current(self, file_path, zip_path):
        
        timestamp, size = self._get_date_and_size(self.zipinfo[zip_path])
        if not os.path.isfile(file_path):
            return False
        stat = os.stat(file_path)
        if stat.st_size != size or stat.st_mtime != timestamp:
            return False
        # check that the contents match
        zip_contents = self.loader.get_data(zip_path)
        with open(file_path, 'rb') as f:
            file_contents = f.read()
        return zip_contents == file_contents
443690
def last_modified(self):
        
        resource_list = self.traffic_incident()
        last_modified = namedtuple('last_modified', 'last_modified')
        if len(resource_list) == 1 and resource_list[0] is None:
            return None
        else:
            try:
                return [last_modified(resource['lastModified'])
                        for resource in resource_list]
            except (KeyError, TypeError):
                return [last_modified(resource['LastModifiedUTC'])
                        for resource in resource_list]
1319043
def getmtime(self, filepath):
        """"""
        if self.is_ssh(filepath):
            self._check_ftp()
            source = self._get_remote(filepath)
            mtime = self.ftp.stat(source).st_mtime
        else:
            mtime = os.path.getmtime(filepath)

        return mtime
365465
def newest_file(file_iterable):
  
  return max(file_iterable, key=lambda fname: os.path.getmtime(fname))