Mercurial > octave-nkf
annotate doc/interpreter/system.txi @ 12288:f07e6b4d34c7 release-3-4-x
Add function compare_versions to documentation.
Update docstrings for surrounding functions in manual.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sat, 29 Jan 2011 16:54:14 -0800 |
parents | 440a6b54e6f1 |
children | 11faa69c4eaa |
rev | line source |
---|---|
11523 | 1 @c Copyright (C) 1996-2011 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 |
6549 | 181 @DOCSTRING(fileattrib) |
182 | |
183 @DOCSTRING(isdir) | |
184 | |
3301 | 185 @DOCSTRING(glob) |
3294 | 186 |
3428 | 187 @DOCSTRING(fnmatch) |
188 | |
3301 | 189 @DOCSTRING(file_in_path) |
3294 | 190 |
3301 | 191 @DOCSTRING(tilde_expand) |
3294 | 192 |
6549 | 193 @DOCSTRING(canonicalize_file_name) |
194 | |
195 @DOCSTRING(movefile) | |
196 | |
197 @DOCSTRING(copyfile) | |
198 | |
199 @DOCSTRING(fileparts) | |
200 | |
201 @DOCSTRING(filesep) | |
202 | |
7984
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7018
diff
changeset
|
203 @DOCSTRING(filemarker) |
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7018
diff
changeset
|
204 |
6549 | 205 @DOCSTRING(fullfile) |
206 | |
207 @DOCSTRING(tempdir) | |
208 | |
209 @DOCSTRING(tempname) | |
210 | |
211 @DOCSTRING(P_tmpdir) | |
212 | |
8817
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8653
diff
changeset
|
213 @DOCSTRING(is_absolute_filename) |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8653
diff
changeset
|
214 |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8653
diff
changeset
|
215 @DOCSTRING(is_rooted_relative_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(make_absolute_filename) |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8653
diff
changeset
|
218 |
6549 | 219 @node File Archiving Utilities |
220 @section File Archiving Utilities | |
221 | |
222 @DOCSTRING(bunzip2) | |
223 | |
6868 | 224 @DOCSTRING(gzip) |
225 | |
6549 | 226 @DOCSTRING(gunzip) |
227 | |
228 @DOCSTRING(tar) | |
229 | |
230 @DOCSTRING(untar) | |
231 | |
232 @DOCSTRING(zip) | |
233 | |
234 @DOCSTRING(unzip) | |
235 | |
236 @DOCSTRING(pack) | |
237 | |
238 @DOCSTRING(unpack) | |
239 | |
8286
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
240 @DOCSTRING(bzip2) |
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
241 |
6549 | 242 @node Networking Utilities |
243 @section Networking Utilities | |
244 | |
9880 | 245 @menu |
11255
d682cd6669ac
Update info-based documentation menus to include new nodes.
Rik <octave@nomad.inbox5.com>
parents:
9891
diff
changeset
|
246 * FTP Objects:: |
d682cd6669ac
Update info-based documentation menus to include new nodes.
Rik <octave@nomad.inbox5.com>
parents:
9891
diff
changeset
|
247 * URL Manipulation:: |
9880 | 248 @end menu |
249 | |
11255
d682cd6669ac
Update info-based documentation menus to include new nodes.
Rik <octave@nomad.inbox5.com>
parents:
9891
diff
changeset
|
250 @node FTP Objects |
d682cd6669ac
Update info-based documentation menus to include new nodes.
Rik <octave@nomad.inbox5.com>
parents:
9891
diff
changeset
|
251 @subsection FTP Objects |
9880 | 252 |
9891
1506a17832c9
doc building fixes for class methods
John W. Eaton <jwe@octave.org>
parents:
9880
diff
changeset
|
253 @DOCSTRING(@ftp/ftp) |
9880 | 254 |
9891
1506a17832c9
doc building fixes for class methods
John W. Eaton <jwe@octave.org>
parents:
9880
diff
changeset
|
255 @DOCSTRING(@ftp/mget) |
9880 | 256 |
9891
1506a17832c9
doc building fixes for class methods
John W. Eaton <jwe@octave.org>
parents:
9880
diff
changeset
|
257 @DOCSTRING(@ftp/mput) |
9880 | 258 |
9891
1506a17832c9
doc building fixes for class methods
John W. Eaton <jwe@octave.org>
parents:
9880
diff
changeset
|
259 @DOCSTRING(@ftp/ascii) |
9880 | 260 |
9891
1506a17832c9
doc building fixes for class methods
John W. Eaton <jwe@octave.org>
parents:
9880
diff
changeset
|
261 @DOCSTRING(@ftp/binary) |
9880 | 262 |
11255
d682cd6669ac
Update info-based documentation menus to include new nodes.
Rik <octave@nomad.inbox5.com>
parents:
9891
diff
changeset
|
263 @node URL Manipulation |
d682cd6669ac
Update info-based documentation menus to include new nodes.
Rik <octave@nomad.inbox5.com>
parents:
9891
diff
changeset
|
264 @subsection URL Manipulation |
9880 | 265 |
6549 | 266 @DOCSTRING(urlread) |
267 | |
268 @DOCSTRING(urlwrite) | |
269 | |
4167 | 270 @node Controlling Subprocesses |
3294 | 271 @section Controlling Subprocesses |
272 | |
273 Octave includes some high-level commands like @code{system} and | |
274 @code{popen} for starting subprocesses. If you want to run another | |
275 program to perform some task and then look at its output, you will | |
276 probably want to use these functions. | |
277 | |
278 Octave also provides several very low-level Unix-like functions which | |
279 can also be used for starting subprocesses, but you should probably only | |
280 use them if you can't find any way to do what you need with the | |
281 higher-level functions. | |
282 | |
3301 | 283 @DOCSTRING(system) |
3294 | 284 |
6549 | 285 @DOCSTRING(unix) |
286 | |
287 @DOCSTRING(dos) | |
288 | |
7984
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7018
diff
changeset
|
289 @DOCSTRING(perl) |
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7018
diff
changeset
|
290 |
3301 | 291 @DOCSTRING(popen) |
3294 | 292 |
3301 | 293 @DOCSTRING(pclose) |
3294 | 294 |
3301 | 295 @DOCSTRING(popen2) |
3294 | 296 |
3301 | 297 @DOCSTRING(EXEC_PATH) |
3294 | 298 |
299 In most cases, the following functions simply decode their arguments and | |
300 make the corresponding Unix system calls. For a complete example of how | |
301 they can be used, look at the definition of the function @code{popen2}. | |
302 | |
3301 | 303 @DOCSTRING(fork) |
3294 | 304 |
3301 | 305 @DOCSTRING(exec) |
3294 | 306 |
3301 | 307 @DOCSTRING(pipe) |
3294 | 308 |
3301 | 309 @DOCSTRING(dup2) |
3294 | 310 |
3301 | 311 @DOCSTRING(waitpid) |
3294 | 312 |
8286
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
313 @DOCSTRING(WCONTINUE) |
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
314 |
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
315 @DOCSTRING(WCOREDUMP) |
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(WEXITSTATUS) |
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(WIFCONTINUED) |
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(WIFSIGNALED) |
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(WIFSTOPPED) |
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(WIFEXITED) |
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(WNOHANG) |
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(WSTOPSIG) |
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(WTERMSIG) |
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(WUNTRACED) |
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
334 |
3301 | 335 @DOCSTRING(fcntl) |
3294 | 336 |
6549 | 337 @DOCSTRING(kill) |
338 | |
339 @DOCSTRING(SIG) | |
340 | |
4167 | 341 @node Process ID Information |
3294 | 342 @section Process, Group, and User IDs |
343 | |
3301 | 344 @DOCSTRING(getpgrp) |
3294 | 345 |
3301 | 346 @DOCSTRING(getpid) |
3294 | 347 |
3301 | 348 @DOCSTRING(getppid) |
3294 | 349 |
3301 | 350 @DOCSTRING(geteuid) |
3294 | 351 |
3301 | 352 @DOCSTRING(getuid) |
3294 | 353 |
3301 | 354 @DOCSTRING(getegid) |
3294 | 355 |
3301 | 356 @DOCSTRING(getgid) |
3294 | 357 |
4167 | 358 @node Environment Variables |
3294 | 359 @section Environment Variables |
360 | |
3301 | 361 @DOCSTRING(getenv) |
3294 | 362 |
3301 | 363 @DOCSTRING(putenv) |
3294 | 364 |
4167 | 365 @node Current Working Directory |
3294 | 366 @section Current Working Directory |
367 | |
3301 | 368 @DOCSTRING(cd) |
3294 | 369 |
3301 | 370 @DOCSTRING(ls) |
3294 | 371 |
6549 | 372 @DOCSTRING(ls_command) |
373 | |
374 @DOCSTRING(dir) | |
375 | |
3301 | 376 @DOCSTRING(pwd) |
3294 | 377 |
4167 | 378 @node Password Database Functions |
3294 | 379 @section Password Database Functions |
380 | |
381 Octave's password database functions return information in a structure | |
382 with the following fields. | |
383 | |
384 @table @code | |
385 @item name | |
386 The user name. | |
387 | |
388 @item passwd | |
389 The encrypted password, if available. | |
390 | |
391 @item uid | |
392 The numeric user id. | |
393 | |
394 @item gid | |
395 The numeric group id. | |
396 | |
397 @item gecos | |
398 The GECOS field. | |
399 | |
400 @item dir | |
401 The home directory. | |
402 | |
403 @item shell | |
404 The initial shell. | |
405 @end table | |
406 | |
407 In the descriptions of the following functions, this data structure is | |
408 referred to as a @var{pw_struct}. | |
409 | |
3301 | 410 @DOCSTRING(getpwent) |
3294 | 411 |
3301 | 412 @DOCSTRING(getpwuid) |
3294 | 413 |
3301 | 414 @DOCSTRING(getpwnam) |
3294 | 415 |
3301 | 416 @DOCSTRING(setpwent) |
3294 | 417 |
3301 | 418 @DOCSTRING(endpwent) |
3294 | 419 |
4167 | 420 @node Group Database Functions |
3294 | 421 @section Group Database Functions |
422 | |
423 Octave's group database functions return information in a structure | |
424 with the following fields. | |
425 | |
426 @table @code | |
427 @item name | |
428 The user name. | |
429 | |
430 @item passwd | |
431 The encrypted password, if available. | |
432 | |
433 @item gid | |
434 The numeric group id. | |
435 | |
436 @item mem | |
437 The members of the group. | |
438 @end table | |
439 | |
440 In the descriptions of the following functions, this data structure is | |
441 referred to as a @var{grp_struct}. | |
442 | |
3301 | 443 @DOCSTRING(getgrent) |
3294 | 444 |
3301 | 445 @DOCSTRING(getgrgid) |
446 | |
447 @DOCSTRING(getgrnam) | |
3294 | 448 |
3301 | 449 @DOCSTRING(setgrent) |
3294 | 450 |
3301 | 451 @DOCSTRING(endgrent) |
3294 | 452 |
4167 | 453 @node System Information |
3294 | 454 @section System Information |
455 | |
3301 | 456 @DOCSTRING(computer) |
3294 | 457 |
6549 | 458 @DOCSTRING(uname) |
459 | |
460 @DOCSTRING(ispc) | |
461 | |
462 @DOCSTRING(isunix) | |
463 | |
8286
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
464 @DOCSTRING(ismac) |
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
465 |
3301 | 466 @DOCSTRING(isieee) |
3294 | 467 |
6623 | 468 @DOCSTRING(OCTAVE_HOME) |
469 | |
12288
f07e6b4d34c7
Add function compare_versions to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11535
diff
changeset
|
470 @DOCSTRING(matlabroot) |
3294 | 471 |
12288
f07e6b4d34c7
Add function compare_versions to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11535
diff
changeset
|
472 @DOCSTRING(OCTAVE_VERSION) |
8286
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
473 |
6623 | 474 @DOCSTRING(version) |
475 | |
476 @DOCSTRING(ver) | |
477 | |
12288
f07e6b4d34c7
Add function compare_versions to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11535
diff
changeset
|
478 @DOCSTRING(compare_versions) |
f07e6b4d34c7
Add function compare_versions to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11535
diff
changeset
|
479 |
f07e6b4d34c7
Add function compare_versions to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11535
diff
changeset
|
480 @DOCSTRING(license) |
f07e6b4d34c7
Add function compare_versions to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11535
diff
changeset
|
481 |
3301 | 482 @DOCSTRING(octave_config_info) |
3294 | 483 |
3301 | 484 @DOCSTRING(getrusage) |
6702 | 485 |
486 @node Hashing Functions | |
487 @section Hashing Functions | |
488 | |
489 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
|
490 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
|
491 and looking for differences. However, this can be slow, and so comparing |
6702 | 492 a hash of the string or file can be a rapid way of finding if the files |
493 differ. | |
494 | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
495 Another use of the hashing function is to check for file integrity. The |
6702 | 496 user can check the hash of the file against a known value and find if |
497 the file they have is the same as the one that the original hash was | |
498 produced with. | |
499 | |
7007 | 500 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
|
501 strings and files. An example of the use of @code{md5sum} function might |
6702 | 502 be |
503 | |
504 @example | |
505 @group | |
506 if exist (file, "file") | |
507 hash = md5sum (file); | |
508 else | |
509 # Treat the variable "file" as a string | |
510 hash = md5sum (file, true); | |
511 endif | |
512 @end group | |
513 @end example | |
514 | |
515 @DOCSTRING(md5sum) |