Mercurial > hg > octave-nkf
annotate doc/interpreter/system.txi @ 10791:3140cb7a05a1
Add spellchecker scripts for Octave and run spellcheck of documentation
interpreter/doccheck: New directory for spelling/grammar scripts.
interpreter/doccheck/README: Instructions for using scripts.
interpreter/doccheck/spellcheck: Script to spellcheck a Texinfo file.
interpreter/doccheck/aspell.conf: GNU Aspell configuration file for
Octave documentation.
interpreter/doccheck/aspell-octave.en.pws: Private Aspell dictionary.
interpreter/doccheck/add_to_aspell_dict: Script to add new
Octave-specific words to
private Aspell dictionary.
interpreter/octave.texi: New @nospell macro which forces Aspell
to ignore the word marked by the macro.
interpreter/mk_doc_cache.m: Skip new @nospell macro when building
doc_cache.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sat, 17 Jul 2010 19:53:01 -0700 |
parents | 1506a17832c9 |
children | d682cd6669ac |
rev | line source |
---|---|
8920 | 1 @c Copyright (C) 1996, 1997, 1999, 2000, 2002, 2007, 2008, 2009 John W. Eaton |
7018 | 2 @c |
3 @c This file is part of Octave. | |
4 @c | |
5 @c Octave is free software; you can redistribute it and/or modify it | |
6 @c under the terms of the GNU General Public License as published by the | |
7 @c Free Software Foundation; either version 3 of the License, or (at | |
8 @c your option) any later version. | |
9 @c | |
10 @c Octave is distributed in the hope that it will be useful, but WITHOUT | |
11 @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
13 @c for more details. | |
14 @c | |
15 @c You should have received a copy of the GNU General Public License | |
16 @c along with Octave; see the file COPYING. If not, see | |
17 @c <http://www.gnu.org/licenses/>. | |
3294 | 18 |
4167 | 19 @node System Utilities |
3294 | 20 @chapter System Utilities |
21 | |
22 This chapter describes the functions that are available to allow you to | |
23 get information about what is happening outside of Octave, while it is | |
24 still running, and use this information in your program. For example, | |
25 you can get information about environment variables, the current time, | |
26 and even start other programs from the Octave prompt. | |
27 | |
28 @menu | |
29 * Timing Utilities:: | |
30 * Filesystem Utilities:: | |
6549 | 31 * File Archiving Utilities:: |
32 * Networking Utilities:: | |
3294 | 33 * Controlling Subprocesses:: |
34 * Process ID Information:: | |
35 * Environment Variables:: | |
36 * Current Working Directory:: | |
37 * Password Database Functions:: | |
38 * Group Database Functions:: | |
39 * System Information:: | |
6702 | 40 * Hashing Functions:: |
3294 | 41 @end menu |
42 | |
4167 | 43 @node Timing Utilities |
3294 | 44 @section Timing Utilities |
45 | |
46 Octave's core set of functions for manipulating time values are | |
47 patterned after the corresponding functions from the standard C library. | |
48 Several of these functions use a data structure for time that includes | |
49 the following elements: | |
50 | |
51 @table @code | |
52 @item usec | |
53 Microseconds after the second (0-999999). | |
54 | |
55 @item sec | |
56 Seconds after the minute (0-61). This number can be 61 to account | |
57 for leap seconds. | |
58 | |
59 @item min | |
60 Minutes after the hour (0-59). | |
61 | |
62 @item hour | |
63 Hours since midnight (0-23). | |
64 | |
65 @item mday | |
66 Day of the month (1-31). | |
67 | |
68 @item mon | |
69 Months since January (0-11). | |
70 | |
71 @item year | |
72 Years since 1900. | |
73 | |
74 @item wday | |
75 Days since Sunday (0-6). | |
76 | |
77 @item yday | |
78 Days since January 1 (0-365). | |
79 | |
80 @item isdst | |
81 Daylight Savings Time flag. | |
82 | |
83 @item zone | |
84 Time zone. | |
85 @end table | |
86 | |
87 @noindent | |
88 In the descriptions of the following functions, this structure is | |
89 referred to as a @var{tm_struct}. | |
90 | |
3301 | 91 @DOCSTRING(time) |
3294 | 92 |
6502 | 93 @DOCSTRING(now) |
94 | |
3294 | 95 @DOCSTRING(ctime) |
96 | |
3301 | 97 @DOCSTRING(gmtime) |
3294 | 98 |
3301 | 99 @DOCSTRING(localtime) |
3294 | 100 |
3301 | 101 @DOCSTRING(mktime) |
3294 | 102 |
3301 | 103 @DOCSTRING(asctime) |
3294 | 104 |
105 @DOCSTRING(strftime) | |
106 | |
4169 | 107 @DOCSTRING(strptime) |
108 | |
3294 | 109 Most of the remaining functions described in this section are not |
110 patterned after the standard C library. Some are available for | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
111 compatibility with @sc{matlab} and others are provided because they are |
3294 | 112 useful. |
113 | |
3301 | 114 @DOCSTRING(clock) |
3294 | 115 |
3301 | 116 @DOCSTRING(date) |
3294 | 117 |
3301 | 118 @DOCSTRING(etime) |
3294 | 119 |
3301 | 120 @DOCSTRING(cputime) |
3294 | 121 |
3301 | 122 @DOCSTRING(is_leap_year) |
3294 | 123 |
8286
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
124 @anchor{doc-toc} |
3301 | 125 @DOCSTRING(tic) |
3294 | 126 |
3301 | 127 @DOCSTRING(pause) |
3294 | 128 |
3301 | 129 @DOCSTRING(sleep) |
3294 | 130 |
3301 | 131 @DOCSTRING(usleep) |
3294 | 132 |
7984
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7018
diff
changeset
|
133 @DOCSTRING(datenum) |
6502 | 134 |
135 @DOCSTRING(datestr) | |
136 | |
137 @DOCSTRING(datevec) | |
138 | |
7984
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7018
diff
changeset
|
139 @DOCSTRING(addtodate) |
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7018
diff
changeset
|
140 |
6502 | 141 @DOCSTRING(calendar) |
142 | |
143 @DOCSTRING(weekday) | |
144 | |
145 @DOCSTRING(eomday) | |
146 | |
8286
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
147 @DOCSTRING(datetick) |
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
148 |
4167 | 149 @node Filesystem Utilities |
3294 | 150 @section Filesystem Utilities |
151 | |
152 Octave includes the following functions for renaming and deleting files, | |
153 creating, deleting, and reading directories, and for getting information | |
154 about the status of files. | |
155 | |
3301 | 156 @DOCSTRING(rename) |
3294 | 157 |
3710 | 158 @DOCSTRING(link) |
159 | |
160 @DOCSTRING(symlink) | |
161 | |
4169 | 162 @DOCSTRING(readlink) |
163 | |
3301 | 164 @DOCSTRING(unlink) |
3294 | 165 |
3301 | 166 @DOCSTRING(readdir) |
3294 | 167 |
3301 | 168 @DOCSTRING(mkdir) |
3294 | 169 |
3301 | 170 @DOCSTRING(rmdir) |
3294 | 171 |
6550 | 172 @DOCSTRING(confirm_recursive_rmdir) |
173 | |
3301 | 174 @DOCSTRING(mkfifo) |
3294 | 175 |
3301 | 176 @DOCSTRING(umask) |
3294 | 177 |
8549 | 178 @anchor{doc-lstat} |
3301 | 179 @DOCSTRING(stat) |
3294 | 180 |
8549 | 181 @DOCSTRING(fstat) |
6549 | 182 |
183 @DOCSTRING(fileattrib) | |
184 | |
185 @DOCSTRING(isdir) | |
186 | |
3301 | 187 @DOCSTRING(glob) |
3294 | 188 |
3428 | 189 @DOCSTRING(fnmatch) |
190 | |
3301 | 191 @DOCSTRING(file_in_path) |
3294 | 192 |
3301 | 193 @DOCSTRING(tilde_expand) |
3294 | 194 |
6549 | 195 @DOCSTRING(canonicalize_file_name) |
196 | |
197 @DOCSTRING(movefile) | |
198 | |
199 @DOCSTRING(copyfile) | |
200 | |
201 @DOCSTRING(fileparts) | |
202 | |
203 @DOCSTRING(filesep) | |
204 | |
7984
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7018
diff
changeset
|
205 @DOCSTRING(filemarker) |
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7018
diff
changeset
|
206 |
6549 | 207 @DOCSTRING(fullfile) |
208 | |
209 @DOCSTRING(tempdir) | |
210 | |
211 @DOCSTRING(tempname) | |
212 | |
213 @DOCSTRING(P_tmpdir) | |
214 | |
8817
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8653
diff
changeset
|
215 @DOCSTRING(is_absolute_filename) |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8653
diff
changeset
|
216 |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8653
diff
changeset
|
217 @DOCSTRING(is_rooted_relative_filename) |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8653
diff
changeset
|
218 |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8653
diff
changeset
|
219 @DOCSTRING(make_absolute_filename) |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8653
diff
changeset
|
220 |
6549 | 221 @node File Archiving Utilities |
222 @section File Archiving Utilities | |
223 | |
224 @DOCSTRING(bunzip2) | |
225 | |
6868 | 226 @DOCSTRING(gzip) |
227 | |
6549 | 228 @DOCSTRING(gunzip) |
229 | |
230 @DOCSTRING(tar) | |
231 | |
232 @DOCSTRING(untar) | |
233 | |
234 @DOCSTRING(zip) | |
235 | |
236 @DOCSTRING(unzip) | |
237 | |
238 @DOCSTRING(pack) | |
239 | |
240 @DOCSTRING(unpack) | |
241 | |
8286
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
242 @DOCSTRING(bzip2) |
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
243 |
6549 | 244 @node Networking Utilities |
245 @section Networking Utilities | |
246 | |
9880 | 247 @menu |
248 * FTP objects:: | |
249 * URL manipulation:: | |
250 @end menu | |
251 | |
252 @node FTP objects | |
253 @subsection FTP objects | |
254 | |
9891
1506a17832c9
doc building fixes for class methods
John W. Eaton <jwe@octave.org>
parents:
9880
diff
changeset
|
255 @DOCSTRING(@ftp/ftp) |
9880 | 256 |
9891
1506a17832c9
doc building fixes for class methods
John W. Eaton <jwe@octave.org>
parents:
9880
diff
changeset
|
257 @DOCSTRING(@ftp/mget) |
9880 | 258 |
9891
1506a17832c9
doc building fixes for class methods
John W. Eaton <jwe@octave.org>
parents:
9880
diff
changeset
|
259 @DOCSTRING(@ftp/mput) |
9880 | 260 |
9891
1506a17832c9
doc building fixes for class methods
John W. Eaton <jwe@octave.org>
parents:
9880
diff
changeset
|
261 @DOCSTRING(@ftp/ascii) |
9880 | 262 |
9891
1506a17832c9
doc building fixes for class methods
John W. Eaton <jwe@octave.org>
parents:
9880
diff
changeset
|
263 @DOCSTRING(@ftp/binary) |
9880 | 264 |
265 @node URL manipulation | |
266 @subsection URL manipulation | |
267 | |
6549 | 268 @DOCSTRING(urlread) |
269 | |
270 @DOCSTRING(urlwrite) | |
271 | |
4167 | 272 @node Controlling Subprocesses |
3294 | 273 @section Controlling Subprocesses |
274 | |
275 Octave includes some high-level commands like @code{system} and | |
276 @code{popen} for starting subprocesses. If you want to run another | |
277 program to perform some task and then look at its output, you will | |
278 probably want to use these functions. | |
279 | |
280 Octave also provides several very low-level Unix-like functions which | |
281 can also be used for starting subprocesses, but you should probably only | |
282 use them if you can't find any way to do what you need with the | |
283 higher-level functions. | |
284 | |
3301 | 285 @DOCSTRING(system) |
3294 | 286 |
6549 | 287 @DOCSTRING(unix) |
288 | |
289 @DOCSTRING(dos) | |
290 | |
7984
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7018
diff
changeset
|
291 @DOCSTRING(perl) |
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7018
diff
changeset
|
292 |
3301 | 293 @DOCSTRING(popen) |
3294 | 294 |
3301 | 295 @DOCSTRING(pclose) |
3294 | 296 |
3301 | 297 @DOCSTRING(popen2) |
3294 | 298 |
3301 | 299 @DOCSTRING(EXEC_PATH) |
3294 | 300 |
301 In most cases, the following functions simply decode their arguments and | |
302 make the corresponding Unix system calls. For a complete example of how | |
303 they can be used, look at the definition of the function @code{popen2}. | |
304 | |
3301 | 305 @DOCSTRING(fork) |
3294 | 306 |
3301 | 307 @DOCSTRING(exec) |
3294 | 308 |
3301 | 309 @DOCSTRING(pipe) |
3294 | 310 |
3301 | 311 @DOCSTRING(dup2) |
3294 | 312 |
3301 | 313 @DOCSTRING(waitpid) |
3294 | 314 |
8286
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
315 @DOCSTRING(WCONTINUE) |
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
316 |
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
317 @DOCSTRING(WCOREDUMP) |
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
318 |
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
319 @DOCSTRING(WEXITSTATUS) |
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
320 |
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
321 @DOCSTRING(WIFCONTINUED) |
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
322 |
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
323 @DOCSTRING(WIFSIGNALED) |
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
324 |
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
325 @DOCSTRING(WIFSTOPPED) |
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
326 |
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
327 @DOCSTRING(WIFEXITED) |
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
328 |
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
329 @DOCSTRING(WNOHANG) |
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
330 |
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
331 @DOCSTRING(WSTOPSIG) |
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
332 |
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
333 @DOCSTRING(WTERMSIG) |
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
334 |
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
335 @DOCSTRING(WUNTRACED) |
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
336 |
3301 | 337 @DOCSTRING(fcntl) |
3294 | 338 |
6549 | 339 @DOCSTRING(kill) |
340 | |
341 @DOCSTRING(SIG) | |
342 | |
4167 | 343 @node Process ID Information |
3294 | 344 @section Process, Group, and User IDs |
345 | |
3301 | 346 @DOCSTRING(getpgrp) |
3294 | 347 |
3301 | 348 @DOCSTRING(getpid) |
3294 | 349 |
3301 | 350 @DOCSTRING(getppid) |
3294 | 351 |
3301 | 352 @DOCSTRING(geteuid) |
3294 | 353 |
3301 | 354 @DOCSTRING(getuid) |
3294 | 355 |
3301 | 356 @DOCSTRING(getegid) |
3294 | 357 |
3301 | 358 @DOCSTRING(getgid) |
3294 | 359 |
4167 | 360 @node Environment Variables |
3294 | 361 @section Environment Variables |
362 | |
3301 | 363 @DOCSTRING(getenv) |
3294 | 364 |
3301 | 365 @DOCSTRING(putenv) |
3294 | 366 |
4167 | 367 @node Current Working Directory |
3294 | 368 @section Current Working Directory |
369 | |
3301 | 370 @DOCSTRING(cd) |
3294 | 371 |
3301 | 372 @DOCSTRING(ls) |
3294 | 373 |
6549 | 374 @DOCSTRING(ls_command) |
375 | |
376 @DOCSTRING(dir) | |
377 | |
3301 | 378 @DOCSTRING(pwd) |
3294 | 379 |
4167 | 380 @node Password Database Functions |
3294 | 381 @section Password Database Functions |
382 | |
383 Octave's password database functions return information in a structure | |
384 with the following fields. | |
385 | |
386 @table @code | |
387 @item name | |
388 The user name. | |
389 | |
390 @item passwd | |
391 The encrypted password, if available. | |
392 | |
393 @item uid | |
394 The numeric user id. | |
395 | |
396 @item gid | |
397 The numeric group id. | |
398 | |
399 @item gecos | |
400 The GECOS field. | |
401 | |
402 @item dir | |
403 The home directory. | |
404 | |
405 @item shell | |
406 The initial shell. | |
407 @end table | |
408 | |
409 In the descriptions of the following functions, this data structure is | |
410 referred to as a @var{pw_struct}. | |
411 | |
3301 | 412 @DOCSTRING(getpwent) |
3294 | 413 |
3301 | 414 @DOCSTRING(getpwuid) |
3294 | 415 |
3301 | 416 @DOCSTRING(getpwnam) |
3294 | 417 |
3301 | 418 @DOCSTRING(setpwent) |
3294 | 419 |
3301 | 420 @DOCSTRING(endpwent) |
3294 | 421 |
4167 | 422 @node Group Database Functions |
3294 | 423 @section Group Database Functions |
424 | |
425 Octave's group database functions return information in a structure | |
426 with the following fields. | |
427 | |
428 @table @code | |
429 @item name | |
430 The user name. | |
431 | |
432 @item passwd | |
433 The encrypted password, if available. | |
434 | |
435 @item gid | |
436 The numeric group id. | |
437 | |
438 @item mem | |
439 The members of the group. | |
440 @end table | |
441 | |
442 In the descriptions of the following functions, this data structure is | |
443 referred to as a @var{grp_struct}. | |
444 | |
3301 | 445 @DOCSTRING(getgrent) |
3294 | 446 |
3301 | 447 @DOCSTRING(getgrgid) |
448 | |
449 @DOCSTRING(getgrnam) | |
3294 | 450 |
3301 | 451 @DOCSTRING(setgrent) |
3294 | 452 |
3301 | 453 @DOCSTRING(endgrent) |
3294 | 454 |
4167 | 455 @node System Information |
3294 | 456 @section System Information |
457 | |
3301 | 458 @DOCSTRING(computer) |
3294 | 459 |
6549 | 460 @DOCSTRING(uname) |
461 | |
462 @DOCSTRING(ispc) | |
463 | |
464 @DOCSTRING(isunix) | |
465 | |
8286
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
466 @DOCSTRING(ismac) |
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
467 |
3301 | 468 @DOCSTRING(isieee) |
3294 | 469 |
6623 | 470 @DOCSTRING(OCTAVE_HOME) |
471 | |
3301 | 472 @DOCSTRING(OCTAVE_VERSION) |
3294 | 473 |
8286
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
474 @DOCSTRING(license) |
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
475 |
6623 | 476 @DOCSTRING(version) |
477 | |
478 @DOCSTRING(ver) | |
479 | |
3301 | 480 @DOCSTRING(octave_config_info) |
3294 | 481 |
3301 | 482 @DOCSTRING(getrusage) |
6702 | 483 |
484 @node Hashing Functions | |
485 @section Hashing Functions | |
486 | |
487 It is often necessary to find if two strings or files are | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
488 identical. This might be done by comparing them character by character |
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
489 and looking for differences. However, this can be slow, and so comparing |
6702 | 490 a hash of the string or file can be a rapid way of finding if the files |
491 differ. | |
492 | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
493 Another use of the hashing function is to check for file integrity. The |
6702 | 494 user can check the hash of the file against a known value and find if |
495 the file they have is the same as the one that the original hash was | |
496 produced with. | |
497 | |
7007 | 498 Octave supplies the @code{md5sum} function to perform MD5 hashes on |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
499 strings and files. An example of the use of @code{md5sum} function might |
6702 | 500 be |
501 | |
502 @example | |
503 @group | |
504 if exist (file, "file") | |
505 hash = md5sum (file); | |
506 else | |
507 # Treat the variable "file" as a string | |
508 hash = md5sum (file, true); | |
509 endif | |
510 @end group | |
511 @end example | |
512 | |
513 @DOCSTRING(md5sum) |