3Copyright (C) 2007, 2009 David Bateman
6This file is part of Octave.
8Octave is free software; you can redistribute it and/or modify it
9under the terms of the GNU General Public License as published by the
10Free Software Foundation; either version 3 of the License, or (at your
11option) any later version.
13Octave is distributed in the hope that it will be useful, but WITHOUT
14ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18You should have received a copy of the GNU General Public License
19along with Octave; see the file COPYING. If not, see
20<http://www.gnu.org/licenses/>.
39DEFUN_DLD (md5sum, args, ,
41@deftypefn {Loadable Function} {} md5sum (@var{file})\n\
42@deftypefnx {Loadable Function} {} md5sum (@var{str}, @var{opt})\n\
43Calculates the MD5 sum of the file @var{file}. If the second parameter\n\
44@var{opt} exists and is true, then calculate the MD5 sum of the\n\
49 int nargin = args.length ();
51 if (nargin != 1 && nargin != 2)
55 bool have_str = false;
56 std::string str = args(0).string_value();
59 have_str = args(1).bool_value();
64 retval = oct_md5 (str);
72 = octave_env::make_absolute (load_path::find_file (str));
76 warning_with_id ("Octave:md5sum-file-in-path",
77 "md5sum: file found in load path");
82 retval = oct_md5_file (str);