3
@node Operating System, Structures, Symbols, Top
4
@chapter Operating System
8
* Operating System Definitions::
11
@node Command Line, Operating System Definitions, Operating System, Operating System
14
The variable si::*command-args* is set to the list of strings passed
15
in when gcl is invoked.
17
Various flags are understood.
20
Call read and then eval on the command argument following @code{-eval}
22
Load the file whose pathname is specified after @code{-load}.
24
Replace si::*command-args* by the the list starting after @code{-f}.
25
Open the file following @code{-f} for input, skip the first line, and then
26
read and eval the rest of the forms in the file. This can be used
27
as with the shells to write small shell programs:
29
#!/usr/local/bin/gcl.exe -f
30
(format t "hello world ~a~%" (nth 1 si::*command-args*))
32
The value si::*command-args* will have the appropriate value.
33
Thus if the above 2 line file is made executable and called @file{foo}
40
NOTE: On many systems (eg SunOs) the first line of an executable script file
43
#!/usr/local/bin/gcl.exe -f
45
only reads the first 32 characters! So if your pathname where the executable
46
together with the '-f' amount to more than 32 characters the file will not
47
be recognized. Also the executable must be the actual large binary file,
49
and not just a @code{/bin/sh} script. In latter case the
50
@code{/bin/sh} interpreter would get invoked on the file.
52
Alternately one could invoke the file @file{foo} without making it
55
tutorial% gcl -f foo "from bill"
59
Finally perhaps the best way (why do we save the best for last..
60
I guess because we only figure it out after all the others..)
61
The following file @file{myhello} has 4 lines:
64
#| Lisp will skip the next 2 lines on reading
67
(format t "hello world ~a~%" (nth 1 si::*command-args*))
71
marie% chmod a+x myhello
76
The advantage of this method is that @file{gcl} can itself
77
be a shell script, which sets up environment and
78
so on. Also the normal path will be searched to find @file{gcl}
79
The disadvantage is that this would cause 2 invocations of @file{sh}
80
and one invocation of @file{gcl}. The plan using @file{gcl.exe}
81
bypasses the @file{sh} entirely. Inded invoking @file{gcl.exe} to
82
print @file{hello world} is faster on most systems than a similar
83
@file{csh} or @file{bash} script, but slightly slower than the old
88
Do not enter the command print loop. Useful if the other command line
89
arguments do something. Do not print the License and acknowledgement
90
information. Note if your program does print any License information,
91
it must print the GCL header information also.
93
Directory where the executable binary that is running is located.
94
Needed by save and friends. This gets set as si::*system-directory*
97
-libdir @file{/d/wfs/gcl-2.0/}
99
would mean that the files like gcl-tk/tk.o would be found by
100
concatting the path to the libdir path, ie in
102
@file{/d/wfs/gcl-2.0/gcl-tk/tk.o}
105
Invoke the compiler on the filename following @code{-compile}.
106
Other flags affect compilation.
108
If nil follows @code{-o-file} then do not produce an @code{.o} file.
110
If @code{-c-file} is specified, leave the intermediate @code{.c} file there.
112
If @code{-h-file} is specified, leave the intermediate @code{.h} file there.
114
If @code{-data-file} is specified, leave the intermediate @code{.data} file there.
116
If @code{-system-p} is specified then invoke @code{compile-file} with the
117
@code{:system-p t} keyword argument, meaning that the C init function
118
will bear a name based on the name of the file, so that it may be invoked
122
@node Operating System Definitions, , Command Line, Operating System
123
@section Operating System Definitions
125
@defun GET-DECODED-TIME ()
128
Returns the current time in decoded time format. Returns nine values: second,
129
minute, hour, date, month, year, day-of-week, daylight-saving-time-p, and
135
@defun HOST-NAMESTRING (pathname)
138
Returns the host part of PATHNAME as a string.
143
@defun RENAME-FILE (file new-name)
146
Renames the file FILE to NEW-NAME. FILE may be a string, a pathname, or
152
@defun FILE-AUTHOR (file)
155
Returns the author name of the specified file, as a string.
156
FILE may be a string or a stream
161
@defun PATHNAME-HOST (pathname)
164
Returns the host slot of PATHNAME.
169
@defun FILE-POSITION (file-stream &optional position)
172
Sets the file pointer of the specified file to POSITION, if POSITION is given.
173
Otherwise, returns the current file position of the specified file.
178
@defun DECODE-UNIVERSAL-TIME (universal-time &optional (timezone -9))
181
Converts UNIVERSAL-TIME into a decoded time at the TIMEZONE.
182
Returns nine values: second, minute, hour, date, month (1 - 12), year,
183
day-of-week (0 - 6), daylight-saving-time-p, and time-zone.
184
TIMEZONE in GCL defaults to 6, the time zone of Austin, Texas.
189
@defun USER-HOMEDIR-PATHNAME (&optional host)
192
Returns the home directory of the logged in user as a pathname. HOST
201
A list of names of the modules that have been loaded into GCL.
206
@defun SHORT-SITE-NAME ()
209
Returns a string that identifies the physical location of the current GCL.
214
@defun DIRECTORY (name)
217
Returns a list of files that match NAME. NAME may be a string, a pathname,
223
@defun SOFTWARE-VERSION ()
226
Returns a string that identifies the software version of the software
227
under which GCL is currently running.
232
@defvr {Constant} INTERNAL-TIME-UNITS-PER-SECOND
234
The number of internal time units that fit into a second.
239
@defun ENOUGH-NAMESTRING (pathname &optional (defaults *default-pathname-defaults*))
242
Returns a string which uniquely identifies PATHNAME with respect to
248
@defun REQUIRE (module-name &optional (pathname))
251
If the specified module is not present, then loads the appropriate file(s).
252
PATHNAME may be a single pathname or it may be a list of pathnames.
257
@defun ENCODE-UNIVERSAL-TIME (second minute hour date month year &optional (timezone ))
260
Does the inverse operation of DECODE-UNIVERSAL-TIME.
265
@defun LISP-IMPLEMENTATION-VERSION ()
268
Returns a string that tells you when the current GCL implementation is
274
@defun MACHINE-INSTANCE ()
277
Returns a string that identifies the machine instance of the machine
278
on which GCL is currently running.
283
@defun ROOM (&optional (x t))
286
Displays information about storage allocation in the following format.
294
the number of pages so-far allocated for the type class
296
the maximum number of pages for the type class
298
the percentage of used cells to cells so-far allocated
300
the number of times the garbage collector has been called to
301
collect cells of the type class
303
the implementation types that belongs to the type class
306
the number of pages actually allocated for contiguous blocks
308
the maximum number of pages for contiguous blocks
310
the number of times the garbage collector has been called to collect
313
the number of pages in the hole
315
the maximum number of pages for relocatable blocks
317
the number of times the garbage collector has been called to collect
320
the total number of pages allocated for cells
322
the total number of pages allocated
324
the number of available pages
326
the number of pages GCL can use.
328
The number of times the garbage collector has been called is not shown,
329
if the number is zero. The optional X is ignored.
334
@defun GET-UNIVERSAL-TIME ()
337
Returns the current time as a single integer in universal time format.
342
@defun GET-INTERNAL-RUN-TIME ()
345
Returns the run time in the internal time format. This is useful for
346
finding CPU usage. If the operating system allows, a second value
347
containing CPU usage of child processes is returned.
352
@defvar *DEFAULT-PATHNAME-DEFAULTS*
354
The default pathname-defaults pathname.
359
@defun LONG-SITE-NAME ()
362
Returns a string that identifies the physical location of the current GCL.
367
@defun DELETE-FILE (file)
374
@defun GET-INTERNAL-REAL-TIME ()
377
Returns the real time in the internal time format. This is useful for
378
finding elapsed time.
383
@defun MACHINE-TYPE ()
386
Returns a string that identifies the machine type of the machine
387
on which GCL is currently running.
400
Evaluates FORM and outputs timing statistics on *TRACE-OUTPUT*.
405
@defun SOFTWARE-TYPE ()
408
Returns a string that identifies the software type of the software
409
under which GCL is currently running.
414
@defun LISP-IMPLEMENTATION-TYPE ()
417
Returns a string that tells you that you are using a version of GCL.
425
This function causes execution to be suspended for N seconds. N may
426
be any non-negative, non-complex number.