diff_file
diff two files or strings.
📝Syntax
res = diff(filename_1, filename_2, with_eol)
📥Input Arguments
Parameter Description
filename_1 a string: a filename.
filename_2 a string: a filename.
with_eol a logical: with end of line considered or not (true by default).
📤Output Arguments
Parameter Description
res a string: '' if no diff detected.
msg a string: error message
📄Description

diff_file compares two files and returns diff as unified format.

if compared files are equals, res is an empty string.

💡Examples
res = diff_file([nelsonroot(), '/etc/startup.m'], [nelsonroot(), '/etc/startup.m'])
res = diff_file([nelsonroot(), '/etc/startup.m'], [nelsonroot(), '/etc/finish.m'])
🔗See Also
isdirisfile
🕔Version History
Version Description
1.0.0 initial version
Edit this page on GitHub