annotate doc/interpreter/system.texi @ 2653:e7908588548a

[project @ 1997-02-01 16:53:52 by jwe]
author jwe
date Sat, 01 Feb 1997 16:57:10 +0000
parents caa21ce81913
children 18192eea4973
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
1 @c Copyright (C) 1996 John W. Eaton
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
2 @c This is part of the Octave manual.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
3 @c For copying conditions, see the file gpl.texi.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
4
2653
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
5 @node System Utilities, Programming Utilities, Audio Processing, Top
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
6 @chapter System Utilities
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
7
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
8 This chapter describes the functions that are available to allow you to
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
9 get information about what is happening outside of Octave, while it is
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
10 still running, and use this information in your program. For example,
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
11 you can get information about environment variables, the current time,
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
12 and even start other programs from the Octave prompt.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
13
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
14 @menu
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
15 * Timing Utilities::
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
16 * Filesystem Utilities::
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
17 * Interacting with the OS::
2460
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
18 * Password Database Functions::
2475
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
19 * Group Database Functions::
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
20 * System Information::
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
21 * Other Functions::
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
22 @end menu
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
23
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
24 @node Timing Utilities, Filesystem Utilities, System Utilities, System Utilities
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
25 @section Timing Utilities
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
26
2465
7ee42ff6536a [project @ 1996-11-03 08:54:14 by jwe]
jwe
parents: 2462
diff changeset
27 @deftypefn {Loadable Function} {} time ()
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
28 Return the current time as the number of seconds since the epoch. The
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
29 epoch is referenced to 00:00:00 CUT (Coordinated Universal Time) 1 Jan
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
30 1970.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
31 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
32
2653
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
33 Several of Octave's time functions use a data structure for time that
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
34 includes the following elements:
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
35
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
36 @table @code
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
37 @item usec
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
38 Microseconds after the second (0-999999).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
39
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
40 @item sec
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
41 Seconds after the minute (0-61). This number can be 61 to account
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
42 for leap seconds.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
43
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
44 @item min
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
45 Minutes after the hour (0-59).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
46
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
47 @item hour
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
48 Hours since midnight (0-23).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
49
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
50 @item mday
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
51 Day of the month (1-31).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
52
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
53 @item mon
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
54 Months since January (0-11).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
55
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
56 @item year
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
57 Years since 1900.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
58
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
59 @item wday
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
60 Days since Sunday (0-6).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
61
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
62 @item yday
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
63 Days since January 1 (0-365).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
64
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
65 @item isdst
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
66 Daylight Savings Time flag.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
67
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
68 @item zone
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
69 Time zone.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
70 @end table
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
71
2465
7ee42ff6536a [project @ 1996-11-03 08:54:14 by jwe]
jwe
parents: 2462
diff changeset
72 @deftypefn {Loadable Function} {} mktime (@var{time_struct})
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
73 Convert a time structure to the number of seconds since the epoch.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
74 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
75
2465
7ee42ff6536a [project @ 1996-11-03 08:54:14 by jwe]
jwe
parents: 2462
diff changeset
76 @deftypefn {Loadable Function} {} localtime (@var{t})
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
77 Given a value returned from time (or any nonnegative integer),
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
78 return a time structure corresponding to the local time zone.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
79 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
80
2465
7ee42ff6536a [project @ 1996-11-03 08:54:14 by jwe]
jwe
parents: 2462
diff changeset
81 @deftypefn {Loadable Function} {} gmtime (@var{t})
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
82 Given a value returned from time (or any nonnegative integer),
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
83 return a time structure corresponding to CUT.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
84 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
85
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
86 @deftypefn {Function File} {} asctime (@var{time_struct})
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
87 Convert a time structure to a string using the following five-field
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
88 format: Thu Mar 28 08:40:14 1996. The function @code{ctime (time)} is
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
89 equivalent to @code{asctime (localtime (time))}.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
90 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
91
2465
7ee42ff6536a [project @ 1996-11-03 08:54:14 by jwe]
jwe
parents: 2462
diff changeset
92 @deftypefn {Loadable Function} {} strftime (@var{time_struct})
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
93 Format a time structure in a flexible way using @samp{%} substitutions
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
94 similar to those in @code{printf}. Except where noted, substituted
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
95 fields have a fixed size; numeric fields are padded if necessary.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
96 Padding is with zeros by default; for fields that display a single
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
97 number, padding can be changed or inhibited by following the @samp{%}
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
98 with one of the modifiers described below. Unknown field specifiers are
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
99 copied as normal characters. All other characters are copied to the
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
100 output without change.
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
101
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
102 Octave's @code{strftime} function supports a superset of the ANSI C
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
103 field specifiers.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
104
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
105 @noindent
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
106 Literal character fields:
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
107
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
108 @table @code
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
109 @item %
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
110 % character.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
111
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
112 @item n
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
113 Newline character.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
114
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
115 @item t
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
116 Tab character.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
117 @end table
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
118
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
119 @noindent
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
120 Numeric modifiers (a nonstandard extension):
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
121
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
122 @table @code
2653
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
123 @item - (dash)
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
124 Do not pad the field.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
125
2653
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
126 @item _ (underscore)
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
127 Pad the field with spaces.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
128 @end table
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
129
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
130 @noindent
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
131 Time fields:
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
132
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
133 @table @code
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
134 @item %H
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
135 Hour (00-23).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
136
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
137 @item %I
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
138 Hour (01-12).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
139
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
140 @item %k
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
141 Hour (0-23).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
142
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
143 @item %l
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
144 Hour (1-12).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
145
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
146 @item %M
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
147 Minute (00-59).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
148
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
149 @item %p
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
150 Locale's AM or PM.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
151
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
152 @item %r
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
153 Time, 12-hour (hh:mm:ss [AP]M).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
154
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
155 @item %R
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
156 Time, 24-hour (hh:mm).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
157
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
158 @item %s
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
159 Time in seconds since 00:00:00, Jan 1, 1970 (a nonstandard extension).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
160
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
161 @item %S
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
162 Second (00-61).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
163
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
164 @item %T
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
165 Time, 24-hour (hh:mm:ss).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
166
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
167 @item %X
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
168 Locale's time representation (%H:%M:%S).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
169
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
170 @item %Z
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
171 Time zone (EDT), or nothing if no time zone is determinable.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
172 @end table
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
173
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
174 @noindent
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
175 Date fields:
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
176
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
177 @table @code
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
178 @item %a
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
179 Locale's abbreviated weekday name (Sun-Sat).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
180
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
181 @item %A
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
182 Locale's full weekday name, variable length (Sunday-Saturday).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
183
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
184 @item %b
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
185 Locale's abbreviated month name (Jan-Dec).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
186
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
187 @item %B
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
188 Locale's full month name, variable length (January-December).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
189
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
190 @item %c
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
191 Locale's date and time (Sat Nov 04 12:02:33 EST 1989).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
192
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
193 @item %C
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
194 Century (00-99).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
195
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
196 @item %d
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
197 Day of month (01-31).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
198
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
199 @item %e
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
200 Day of month ( 1-31).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
201
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
202 @item %D
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
203 Date (mm/dd/yy).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
204
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
205 @item %h
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
206 Same as %b.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
207
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
208 @item %j
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
209 Day of year (001-366).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
210
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
211 @item %m
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
212 Month (01-12).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
213
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
214 @item %U
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
215 Week number of year with Sunday as first day of week (00-53).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
216
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
217 @item %w
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
218 Day of week (0-6).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
219
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
220 @item %W
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
221 Week number of year with Monday as first day of week (00-53).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
222
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
223 @item %x
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
224 Locale's date representation (mm/dd/yy).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
225
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
226 @item %y
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
227 Last two digits of year (00-99).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
228
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
229 @item %Y
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
230 Year (1970-).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
231 @end table
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
232 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
233
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
234 @deftypefn {Function File} {} clock ()
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
235 Return a vector containing the current year, month (1-12), day (1-31),
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
236 hour (0-23), minute (0-59) and second (0-61). For example,
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
237
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
238 @example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
239 octave:13> clock
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
240 ans =
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
241
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
242 1993 8 20 4 56 1
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
243 @end example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
244
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
245 The function clock is more accurate on systems that have the
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
246 @code{gettimeofday} function.
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
247 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
248
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
249 @deftypefn {Function File} {} date ()
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
250 Returns the date as a character string in the form DD-MMM-YY. For
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
251 example,
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
252
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
253 @example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
254 octave:13> date
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
255 ans = 20-Aug-93
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
256 @end example
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
257 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
258
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
259 @deftypefn {Function File} {} etime (@var{t1}, @var{t2})
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
260 Return the difference (in seconds) between two time values returned from
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
261 @code{clock}. For example:
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
262
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
263 @example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
264 t0 = clock ();
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
265 # many computations later...
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
266 elapsed_time = etime (clock (), t0);
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
267 @end example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
268
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
269 @noindent
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
270 will set the variable @code{elapsed_time} to the number of seconds since
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
271 the variable @code{t0} was set.
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
272 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
273
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
274 @deftypefn {Built-in Function} {[@var{total}, @var{user}, @var{system}] =} cputime ();
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
275 Return the CPU time used by your Octave session. The first output is
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
276 the total time spent executing your process and is equal to the sum of
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
277 second and third outputs, which are the number of CPU seconds spent
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
278 executing in user mode and the number of CPU seconds spent executing in
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
279 system mode, respectively. If your system does not have a way to report
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
280 CPU time usage, @code{cputime} returns 0 for each of its output values.
2653
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
281 Note that because Octave used some CPU time to start, it is reasonable
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
282 to check to see if @code{cputime} works by checking to see if the total
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
283 CPU time used is nonzero.
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
284 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
285
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
286 @deftypefn {Function File} {} is_leap_year (@var{year})
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
287 Return 1 if the given year is a leap year and 0 otherwise. If no
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
288 arguments are provided, @code{is_leap_year} will use the current year.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
289 For example,
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
290
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
291 @example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
292 octave:13> is_leap_year (2000)
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
293 ans = 1
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
294 @end example
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
295 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
296
2653
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
297 @deftypefn {Function File} {} tic ()
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
298 @deftypefnx {Function File} {} toc ()
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
299 These functions set and check a wall-clock timer. For example,
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
300
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
301 @example
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
302 tic ();
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
303 # many computations later...
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
304 elapsed_time = toc ();
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
305 @end example
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
306
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
307 @noindent
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
308 will set the variable @code{elapsed_time} to the number of seconds since
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
309 the most recent call to the function @code{tic}.
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
310
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
311 If you are more interested in the CPU time that your process used, you
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
312 should use the @code{cputime} function instead. The @code{tic} and
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
313 @code{toc} functions report the actual wall clock time that elapsed
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
314 between the calls. This may include time spent processing other jobs or
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
315 doing nothing at all. For example,
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
316
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
317 @example
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
318 @group
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
319 tic (); sleep (5); toc ()
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
320 @result{} 5
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
321 t = cputime (); sleep (5); cputime () - t
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
322 @result{} 0
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
323 @end group
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
324 @end example
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
325
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
326 @noindent
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
327 (This example also illustrates that the CPU timer may have a fairly
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
328 coarse resolution.)
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
329 @end deftypefn
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
330
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
331 @node Filesystem Utilities, Interacting with the OS, Timing Utilities, System Utilities
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
332 @section Filesystem Utilities
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
334 Octave includes the following functions for renaming and deleting files,
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
335 creating, deleting, and reading directories, and for getting information
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
336 about the status of files.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
337
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
338 @deftypefn {Built-in Function} {} rename (@var{from}, @var{to})
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
339 Rename a file.
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
340 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
341
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
342 @deftypefn {Built-in Function} {} unlink (@var{file})
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
343 Delete a file.
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
344 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
345
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
346 @deftypefn {Built-in Function} {} readdir (@var{dir})
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
347 Returns names of files in the directory @var{dir} as an array of
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
348 strings.
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
349 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
350
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
351 @deftypefn {Built-in Function} {} mkdir (@var{dir})
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
352 Create a directory
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
353 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
354
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
355 @deftypefn {Built-in Function} {} rmdir (@var{dir})
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
356 Remove a directory.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
357 @end deftypefn
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
358
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
359 @c XXX FIXME XXX -- this needs to be explained, but I don't feel up to
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
360 @c it just now...
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
361
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
362 @deftypefn {Built-in Function} {} umask (@var{mask})
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
363 Set permission mask for file creation.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
364 @end deftypefn
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
365
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
366 @deftypefn {Built-in Function} {} stat (@var{file})
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
367 Get information about a file. If @var{file} is a symbolic link,
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
368 @code{stat} returns information about the file that the symbolic link
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
369 references.
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
370 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
371
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
372 @deftypefn {Built-in Function} {} lstat (@var{file})
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
373 Get information about a symbolic link. If @var{file} is not a symbolic
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
374 link, @code{lstat} is equivalent to @code{stat}.
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
375 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
376
2495
29cd3862a9dc [project @ 1996-11-11 02:39:49 by jwe]
jwe
parents: 2475
diff changeset
377 @deftypefn {Built-in Function} {} glob (@var{pattern})
29cd3862a9dc [project @ 1996-11-11 02:39:49 by jwe]
jwe
parents: 2475
diff changeset
378 Given an array of strings in @var{pattern}, return the list of file
29cd3862a9dc [project @ 1996-11-11 02:39:49 by jwe]
jwe
parents: 2475
diff changeset
379 names that any of them, or an empty string if no patterns match. Tilde
29cd3862a9dc [project @ 1996-11-11 02:39:49 by jwe]
jwe
parents: 2475
diff changeset
380 expansion is performed on each of the patterns before looking for
29cd3862a9dc [project @ 1996-11-11 02:39:49 by jwe]
jwe
parents: 2475
diff changeset
381 matching file names.
29cd3862a9dc [project @ 1996-11-11 02:39:49 by jwe]
jwe
parents: 2475
diff changeset
382 @end deftypefn
29cd3862a9dc [project @ 1996-11-11 02:39:49 by jwe]
jwe
parents: 2475
diff changeset
383
2496
9823f8bfd1a5 [project @ 1996-11-11 03:17:10 by jwe]
jwe
parents: 2495
diff changeset
384 @deftypefn {Built-in Function} {} fnmatch (@var{pattern}, @var{string})
9823f8bfd1a5 [project @ 1996-11-11 03:17:10 by jwe]
jwe
parents: 2495
diff changeset
385 Return 1 or zero for each element of @var{string} that matches any of
9823f8bfd1a5 [project @ 1996-11-11 03:17:10 by jwe]
jwe
parents: 2495
diff changeset
386 the elements of the string array @var{pattern}, using the rules of
9823f8bfd1a5 [project @ 1996-11-11 03:17:10 by jwe]
jwe
parents: 2495
diff changeset
387 filename pattern matching.
9823f8bfd1a5 [project @ 1996-11-11 03:17:10 by jwe]
jwe
parents: 2495
diff changeset
388 @end deftypefn
9823f8bfd1a5 [project @ 1996-11-11 03:17:10 by jwe]
jwe
parents: 2495
diff changeset
389
2460
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
390 @node Interacting with the OS, Password Database Functions, Filesystem Utilities, System Utilities
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
391 @section Interacting with the OS
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
392
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
393 @deftypefn {Built-in Function} {} fork ()
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
394 Create a copy of the current process.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
395 @end deftypefn
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
396
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
397 @deftypefn {Built-in Function} {} exec (@var{file}, @var{args})
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
398 Replace current process with a new process.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
399 @end deftypefn
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
400
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
401 @deftypefn {Built-in Function} {fid =} dup2 (@var{old}, @var{new})
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
402 Duplicate a file descriptor.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
403 @end deftypefn
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
404
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
405 @deftypefn {Built-in Function} {[@var{file_ids}, @var{status}] =} pipe ()
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
406 Create an interprocess channel.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
407 @end deftypefn
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
408
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
409 @deftypefn {Built-in Function} {} fcntl (@var{fid}, @var{request}, @var{argument})
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
410 Control open file descriptors.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
411
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
412 @vtable @code
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
413 @item F_DUPFD
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
414 @item F_GETFD
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
415 @item F_GETFL
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
416 @item F_SETFD
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
417 @item F_SETFL
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
418 @item O_APPEND
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
419 @item O_CREAT
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
420 @item O_EXCL
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
421 @item O_NONBLOCK
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
422 @item O_RDONLY
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
423 @item O_RDWR
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
424 @item O_TRUNC
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
425 @item O_WRONLY
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
426 @end vtable
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
427 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
428
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
429 @deftypefn {Built-in Function} {} getpgrp ()
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
430 Return the process group id of the current process.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
431 @end deftypefn
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
432
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
433 @deftypefn {Built-in Function} {} getpid ()
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
434 Return the process id of the current process.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
435 @end deftypefn
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
436
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
437 @deftypefn {Built-in Function} {} getppid ()
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
438 Return the process id of the parent process.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
439 @end deftypefn
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
440
2475
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
441 @deftypefn {Built-in Function} {} geteuid ()
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
442 Return the effective user id of the current process.
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
443 @end deftypefn
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
444
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
445 @deftypefn {Built-in Function} {} getuid ()
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
446 Return the real user id of the current process.
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
447 @end deftypefn
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
448
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
449 @deftypefn {Built-in Function} {} getegid ()
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
450 Return the effective group id of the current process.
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
451 @end deftypefn
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
452
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
453 @deftypefn {Built-in Function} {} getgid ()
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
454 Return the real group id of the current process.
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
455 @end deftypefn
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
456
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
457 @deftypefn {Built-in Function} {} mkfifo
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
458 Create a FIFO special file.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
459 @end deftypefn
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
460
2653
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
461 @deftypefn {Built-in Function} {} waitpid (@var{pid}, @var{options})
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
462 Wait for process @var{pid} to terminate. The @var{pid} argument can be:
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
463
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
464 @table @asis
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
465 @item -1
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
466 Wait for any child process.
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
467
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
468 @item 0
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
469 Wait for any child process whose process group ID is equal to that of
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
470 the Octave interpreter process.
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
471
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
472 @item > 0
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
473 Wait for termination of the child process with ID @var{PID}.
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
474 @end table
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
475
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
476 The @var{options} argument can be:
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
477
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
478 @table @asis
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
479 @item 0
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
480 Wait until signal is received or a child process exits (this is the
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
481 default if the @var{options} argument is missing).
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
482
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
483 @item 1
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
484 Do not hang if status is not immediately available.
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
485
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
486 @item 2
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
487 Report the status of any child processes that are stopped, and whose
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
488 status has not yet been reported since they stopped.
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
489
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
490 @item 3
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
491 Implies both 1 and 2.
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
492 @end table
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
493
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
494 If the return value is greater than 0, it is the process ID of the child
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
495 process that exited. If an error occurs, -1 is returned.
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
496 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
497
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
498 @deftypefn {Built-in Function} {} atexit (@var{fcn})
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
499 Register function to be called when Octave exits.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
500 @end deftypefn
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
501
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
502 @deftypefn {Built-in Function} {} system (@var{string}, @var{return_output}, @var{type})
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
503 Execute a shell command specified by @var{string}. The second argument is optional.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
504 If @var{type} is @code{"async"}, the process is started in the
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
505 background and the process id of the child proces is returned
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
506 immediately. Otherwise, the process is started, and Octave waits until
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
507 it exits. If @var{type} argument is omitted, a value of @code{"sync"}
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
508 is assumed.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
509
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
510 If two input arguments are given (the actual value of
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
511 @var{return_output} is irrelevant) and the subprocess is started
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
512 synchronously, or if @var{system} is called with one input argument and
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
513 one or more output arguments, the output from the command is returned.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
514 Otherwise, if the subprocess is executed synchronously, it's output is
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
515 sent to the standard output. To send the output of a command executed
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
516 with @var{system} through the pager, use a command like
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
517
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
518 @example
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
519 disp (system (cmd, 1));
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
520 @end example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
521
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
522 @noindent
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
523 or
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
524
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
525 @example
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
526 printf ("%s\n", system (cmd, 1));
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
527 @end example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
528
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
529 The @code{system} function can return two values. The first is any
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
530 output from the command that was written to the standard output stream,
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
531 and the second is the output status of the command. For example,
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
532
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
533 @example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
534 [output, status] = system ("echo foo; exit 2");
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
535 @end example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
536
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
537 @noindent
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
538 will set the variable @code{output} to the string @samp{foo}, and the
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
539 variable @code{status} to the integer @samp{2}.
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
540 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
541
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
542 @defvr {Built-in Variable} EXEC_PATH
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
543 The variable @code{EXEC_PATH} is a colon separated list of directories
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
544 to search when executing subprograms. Its initial value is taken from
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
545 the environment variable @code{OCTAVE_EXEC_PATH} (if it exists) or
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
546 @code{PATH}, but that value can be overridden by the the command line
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
547 argument @code{--exec-path PATH}, or by setting the value of
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
548 @code{EXEC_PATH} in a startup script. If the value of @code{EXEC_PATH}
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
549 begins (ends) with a colon, the directories
2535
caa21ce81913 [project @ 1996-11-19 19:53:55 by jwe]
jwe
parents: 2496
diff changeset
550
caa21ce81913 [project @ 1996-11-19 19:53:55 by jwe]
jwe
parents: 2496
diff changeset
551 @example
caa21ce81913 [project @ 1996-11-19 19:53:55 by jwe]
jwe
parents: 2496
diff changeset
552 OCTAVE_HOME/libexec/octave/site/exec/ARCH
caa21ce81913 [project @ 1996-11-19 19:53:55 by jwe]
jwe
parents: 2496
diff changeset
553 OCTAVE_HOME/libexec/octave/VERSION/exec/ARCH
caa21ce81913 [project @ 1996-11-19 19:53:55 by jwe]
jwe
parents: 2496
diff changeset
554 OCTAVE_HOME/bin
caa21ce81913 [project @ 1996-11-19 19:53:55 by jwe]
jwe
parents: 2496
diff changeset
555 @end example
caa21ce81913 [project @ 1996-11-19 19:53:55 by jwe]
jwe
parents: 2496
diff changeset
556
caa21ce81913 [project @ 1996-11-19 19:53:55 by jwe]
jwe
parents: 2496
diff changeset
557 @noindent
caa21ce81913 [project @ 1996-11-19 19:53:55 by jwe]
jwe
parents: 2496
diff changeset
558 are prepended (appended) to @code{EXEC_PATH}, where @code{OCTAVE_HOME}
caa21ce81913 [project @ 1996-11-19 19:53:55 by jwe]
jwe
parents: 2496
diff changeset
559 is the top-level directory where all of Octave is installed
caa21ce81913 [project @ 1996-11-19 19:53:55 by jwe]
jwe
parents: 2496
diff changeset
560 (@file{/usr/local} by default). If you don't specify a value for
caa21ce81913 [project @ 1996-11-19 19:53:55 by jwe]
jwe
parents: 2496
diff changeset
561 @code{EXEC_PATH} explicitly, these special directories are prepended to
caa21ce81913 [project @ 1996-11-19 19:53:55 by jwe]
jwe
parents: 2496
diff changeset
562 your shell path.
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
563 @end defvr
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
564
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
565 @deftypefn {Built-in Function} {} getenv (@var{var})
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
566 Returns the value of the environment variable @var{var}. For example,
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
567
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
568 @example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
569 getenv ("PATH")
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
570 @end example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
571
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
572 @noindent
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
573 returns a string containing the value of your path.
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
574 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
575
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
576 @deftypefn {Built-in Function} {} putenv (@var{var}, @var{value})
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
577 Set the value of the environment variable @var{var} to @var{value}.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
578 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
579
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
580 @deftypefn {Built-in Function} {} clc ()
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
581 @deftypefnx {Built-in Function} {} home ()
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
582 Clear the terminal screen and move the cursor to the upper left corner.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
583 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
584
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
585 @deffn {Command} cd dir
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
586 @deffnx {Command} chdir dir
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
587 Change the current working directory to @var{dir}. For example,
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
588
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
589 @example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
590 cd ~/octave
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
591 @end example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
592
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
593 @noindent
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
594 Changes the current working directory to @file{~/octave}. If the
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
595 directory does not exist, an error message is printed and the working
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
596 directory is not changed.
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
597 @end deffn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
598
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
599 @deftypefn {Built-in Function} {} pwd ()
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
600 Returns the current working directory.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
601 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
602
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
603 @defvr {Built-in Variable} PWD
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
604 The current working directory. The value of @code{PWD} is updated each
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
605 time the current working directory is changed with the @samp{cd}
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
606 command.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
607 @end defvr
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
608
2653
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
609 @deffn {Command} ls options
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
610 @deffnx {Command} dir options
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
611 List directory contents. For example,
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
612
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
613 @example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
614 octave:13> ls -l
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
615 total 12
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
616 -rw-r--r-- 1 jwe users 4488 Aug 19 04:02 foo.m
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
617 -rw-r--r-- 1 jwe users 1315 Aug 17 23:14 bar.m
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
618 @end example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
619
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
620 The @code{dir} and @code{ls} commands are implemented by calling your
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
621 system's directory listing command, so the available options may vary
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
622 from system to system.
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
623 @end deffn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
624
2475
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
625 @node Password Database Functions, Group Database Functions, Interacting with the OS, System Utilities
2460
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
626 @section Password Database Functions
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
627
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
628 Octave's password database functions return information in a structure
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
629 with the following fields.
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
630
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
631 @table @code
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
632 @item name
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
633 The user name.
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
634
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
635 @item passwd
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
636 The encrypted password, if available.
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
637
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
638 @item uid
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
639 The numeric user id.
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
640
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
641 @item gid
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
642 The numeric group id.
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
643
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
644 @item gecos
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
645 The GECOS field.
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
646
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
647 @item dir
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
648 The home directory.
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
649
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
650 @item shell
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
651 The initial shell.
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
652 @end table
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
653
2465
7ee42ff6536a [project @ 1996-11-03 08:54:14 by jwe]
jwe
parents: 2462
diff changeset
654 @deftypefn {Loadable Function} {passwd_struct =} getpwent ()
2460
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
655 Return an entry from the password database, opening it if necessary.
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
656 Once the end of the data has been reached, @code{getpwent} returns 0.
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
657 @end deftypefn
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
658
2465
7ee42ff6536a [project @ 1996-11-03 08:54:14 by jwe]
jwe
parents: 2462
diff changeset
659 @deftypefn {Loadable Function} {passwd_struct =} getpwuid (@var{uid}).
2460
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
660 Return the first entry from the password database with the user ID
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
661 @var{uid}. If the user ID does not exist in the database,
2462
5edc0b8b0543 [project @ 1996-11-03 05:52:52 by jwe]
jwe
parents: 2460
diff changeset
662 @code{getpwuid} returns 0.
2460
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
663 @end deftypefn
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
664
2465
7ee42ff6536a [project @ 1996-11-03 08:54:14 by jwe]
jwe
parents: 2462
diff changeset
665 @deftypefn {Loadable Function} {passwd_struct =} getpwnam (@var{name})
2460
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
666 Return the first entry from the password database with the user name
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
667 @var{name}. If the user name does not exist in the database,
2462
5edc0b8b0543 [project @ 1996-11-03 05:52:52 by jwe]
jwe
parents: 2460
diff changeset
668 @code{getpwname} returns 0.
2460
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
669 @end deftypefn
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
670
2465
7ee42ff6536a [project @ 1996-11-03 08:54:14 by jwe]
jwe
parents: 2462
diff changeset
671 @deftypefn {Loadable Function} {} setpwent ()
2460
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
672 Return the internal pointer to the beginning of the password database.
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
673 @end deftypefn
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
674
2465
7ee42ff6536a [project @ 1996-11-03 08:54:14 by jwe]
jwe
parents: 2462
diff changeset
675 @deftypefn {Loadable Function} {} endpwent ()
2460
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
676 Close the password database.
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
677 @end deftypefn
4690fe4c0333 [project @ 1996-11-03 03:49:55 by jwe]
jwe
parents: 2449
diff changeset
678
2475
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
679 @node Group Database Functions, System Information, Password Database Functions, System Utilities
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
680 @section Group Database Functions
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
681
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
682 Octave's group database functions return information in a structure
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
683 with the following fields.
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
684
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
685 @table @code
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
686 @item name
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
687 The user name.
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
688
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
689 @item passwd
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
690 The encrypted password, if available.
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
691
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
692 @item gid
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
693 The numeric group id.
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
694
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
695 @item mem
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
696 The members of the group.
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
697 @end table
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
698
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
699 @deftypefn {Loadable Function} {group_struct =} getgrent ()
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
700 Return an entry from the group database, opening it if necessary.
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
701 Once the end of the data has been reached, @code{getgrent} returns 0.
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
702 @end deftypefn
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
703
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
704 @deftypefn {Loadable Function} {group_struct =} getgrgid (@var{gid}).
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
705 Return the first entry from the group database with the group ID
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
706 @var{gid}. If the group ID does not exist in the database,
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
707 @code{getgrgid} returns 0.
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
708 @end deftypefn
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
709
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
710 @deftypefn {Loadable Function} {group_struct =} getgrnam (@var{name})
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
711 Return the first entry from the group database with the group name
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
712 @var{name}. If the group name does not exist in the database,
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
713 @code{getgrname} returns 0.
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
714 @end deftypefn
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
715
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
716 @deftypefn {Loadable Function} {} setgrent ()
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
717 Return the internal pointer to the beginning of the group database.
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
718 @end deftypefn
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
719
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
720 @deftypefn {Loadable Function} {} endgrent ()
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
721 Close the group database.
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
722 @end deftypefn
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
723
1d7925d6bede [project @ 1996-11-07 04:36:00 by jwe]
jwe
parents: 2469
diff changeset
724 @node System Information, Other Functions, Group Database Functions, System Utilities
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
725 @section System Information
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
726
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
727 @deftypefn {Built-in Function} {} computer ()
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
728 Returns a string of the form @var{cpu}-@var{vendor}-@var{os} that
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
729 identifies the kind of computer Octave is running on. For example,
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
730
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
731 @example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
732 octave:13> computer
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
733 sparc-sun-sunos4.1.2
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
734 @end example
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
735 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
736
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
737 @deftypefn {Built-in Function} {} isieee ()
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
738 Return 1 if your computer claims to conform to the IEEE standard for
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
739 floating point calculations.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
740 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
741
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
742 @deftypefn {Built-in Function} {} version ()
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
743 Returns Octave's version number as a string. This is also the value of
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
744 the built-in variable @code{OCTAVE_VERSION}. @xref{Built-in Variables}.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
745 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
746
2465
7ee42ff6536a [project @ 1996-11-03 08:54:14 by jwe]
jwe
parents: 2462
diff changeset
747 @deftypefn {Loadable Function} {} getrusage ()
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
748 Return a structure containing a number of statistics about the current
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
749 Octave process. Not all fields are available on all systems. If it is
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
750 not possible to get CPU time statistics, the CPU time slots are set to
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
751 zero. Other missing data are replaced by NaN. Here is a list of all
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
752 the possible fields that can be present in the structure returned by
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
753 @code{getrusage}:
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
754
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
755 @table @code
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
756 @item
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
757 @item idrss
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
758 Unshared data size.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
759
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
760 @item inblock
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
761 Number of block input operations.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
762
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
763 @item isrss
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
764 Unshared stack size.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
765
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
766 @item ixrss
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
767 Shared memory size.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
768
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
769 @item majflt
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
770 Number of major page faults.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
771
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
772 @item maxrss
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
773 Maximum data size.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
774
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
775 @item minflt
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
776 Number of minor page faults.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
777
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
778 @item msgrcv
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
779 Number of messages received.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
780
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
781 @item msgsnd
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
782 Number of messages sent.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
783
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
784 @item nivcsw
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
785 Number of involuntary context switches.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
786
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
787 @item nsignals
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
788 Number of signals received.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
789
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
790 @item nswap
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
791 Number of swaps.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
792
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
793 @item nvcsw
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
794 Number of voluntary context switches.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
795
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
796 @item oublock
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
797 Number of block output operations.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
798
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
799 @item stime
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
800 A structure containing the system CPU time used. The structure has the
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
801 elements @code{sec} (seconds) @code{usec} (microseconds).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
802
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
803 @item utime
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
804 A structure containing the user CPU time used. The structure has the
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
805 elements @code{sec} (seconds) @code{usec} (microseconds).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
806 @end table
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
807 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
808
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
809 @node Other Functions, , System Information, System Utilities
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
810 @section Other Functions
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
811
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
812 @c XXX FIXME XXX -- need to define tilde expansion.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
813
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
814 @deftypefn {Built-in Function} {} tilde_expand (@var{string})
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
815 Performs tilde expansion on @var{string}.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
816 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
817
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
818 @deftypefn {Built-in Function} {} pause (@var{seconds})
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
819 Suspend the execution of the program. If invoked without any arguments,
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
820 Octave waits until you type a character. With a numeric argument, it
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
821 pauses for the given number of seconds. For example, the following
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
822 statement prints a message and then waits 5 seconds before clearing the
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
823 screen.
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
824
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
825 @example
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
826 @group
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
827 fprintf (stderr, "wait please...\n");
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
828 pause (5);
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
829 clc;
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
830 @end group
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
831 @end example
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
832 @end deftypefn
2653
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
833
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
834 @deftypefn {Built-in Function} {} sleep (@var{seconds})
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
835 Suspend the execution of the program.
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
836 @end deftypefn
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
837
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
838 @deftypefn {Built-in Function} {} usleep (@var{microseconds})
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
839 Suspend the execution of the program.
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
840 @end deftypefn
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
841
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
842 @c XXX FIXME XXX -- not really sure where these should go.
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
843
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
844 @cindex exiting octave
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
845 @cindex quitting octave
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
846
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
847 @deftypefn {Built-in Function} {} exit (@var{status})
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
848 @deftypefnx {Built-in Function} {} quit (@var{status})
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
849 Exit the current Octave session. If the optional integer value
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
850 @var{status} is supplied, pass that value to the operating system as the
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
851 Octave's exit status.
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2535
diff changeset
852 @end deftypefn