File Exchange

image thumbnail


Check for updates and replace old files

1 Download

Updated 15 Jul 2014

View License

Check for updates and replace old files. It's possible to compare the modification date and the file size. Useful when some files are modified in one directory and you want to synchronize them with another folder.
old_files = update_check(fpath)
[old_files not_found] = update_check(fpath)

[...] = update_check(fpath)
[...] = update_check(fpath, rec)
[...] = update_check(fpath, rec, crit)
[...] = update_check(fpath, rec, crit, ext)
[...] = update_check(fpath, rec, crit, ext, replace)

- FPATH: parent folder to search for changes (the original files are expected to be in MATLAB's search path)
- REC: 1 (search for files recursively, i.e., include all FPATH subfolders), 0 (only FPATH) [default: 0]
- CRIT: criterion: 'time' (compare the modification date) or 'size' (compare the file size) [default: 'time']
- EXT: cell array containing the file extension [default: {'m' 'mat' 'fig'}]
- REPLACE: 1 (replace old files), 0 (don't replace) [default: 0]

If any of the input variables is empty or missing, the default value will be used.

- OLD_FILES: cell array with the name and path of the old files
- NOT_FOUND: cell array with the name and path of the files that were not found in the search path

Cite As

Guilherme Coco Beltramini (2020). update_check (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (0)

MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags