mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-01 01:40:21 +02:00
* popen.scm, slib.scm: Added some docstrings for procedures that
were primitives that I encountered in posix.texi.
This commit is contained in:
parent
1ae4c71d30
commit
ea4bcd7b54
2 changed files with 19 additions and 1 deletions
|
@ -40,6 +40,10 @@
|
||||||
pid))))))
|
pid))))))
|
||||||
|
|
||||||
(define-public (open-pipe command mode)
|
(define-public (open-pipe command mode)
|
||||||
|
"Executes the shell command @var{command} (a string) in a subprocess.
|
||||||
|
A pipe to the process is created and returned. @var{modes} specifies
|
||||||
|
whether an input or output pipe to the process is created: it should
|
||||||
|
be the value of @code{OPEN_READ} or @code{OPEN_WRITE}."
|
||||||
(let* ((port/pid (open-process mode "/bin/sh" "-c" command))
|
(let* ((port/pid (open-process mode "/bin/sh" "-c" command))
|
||||||
(port (car port/pid)))
|
(port (car port/pid)))
|
||||||
(pipe-guardian port)
|
(pipe-guardian port)
|
||||||
|
@ -56,6 +60,9 @@
|
||||||
(cdr (waitpid (cdr port/pid))))
|
(cdr (waitpid (cdr port/pid))))
|
||||||
|
|
||||||
(define-public (close-pipe p)
|
(define-public (close-pipe p)
|
||||||
|
"Closes the pipe created by @code{open-pipe}, then waits for the process
|
||||||
|
to terminate and returns its status value, @xref{Processes, waitpid}, for
|
||||||
|
information on how to interpret this value."
|
||||||
(let ((pid (fetch-pid p)))
|
(let ((pid (fetch-pid p)))
|
||||||
(if (not pid)
|
(if (not pid)
|
||||||
(error "close-pipe: pipe not in table"))
|
(error "close-pipe: pipe not in table"))
|
||||||
|
|
|
@ -212,7 +212,18 @@
|
||||||
'*sc-expander*
|
'*sc-expander*
|
||||||
'(define)))
|
'(define)))
|
||||||
|
|
||||||
(define (software-type) 'UNIX)
|
(define (software-type)
|
||||||
|
"Return a symbol describing the current platform's operating system.
|
||||||
|
This may be one of AIX, VMS, UNIX, COHERENT, WINDOWS, MS-DOS, OS/2,
|
||||||
|
THINKC, AMIGA, ATARIST, MACH, or ACORN.
|
||||||
|
|
||||||
|
Note that most varieties of Unix are considered to be simply \"UNIX\".
|
||||||
|
That is because when a program depends on features that are not present
|
||||||
|
on every operating system, it is usually better to test for the presence
|
||||||
|
or absence of that specific feature. The return value of
|
||||||
|
@code{software-type} should only be used for this purpose when there is
|
||||||
|
no other easy or unambiguous way of detecting such features."
|
||||||
|
'UNIX)
|
||||||
|
|
||||||
(slib:load (in-vicinity (library-vicinity) "require.scm"))
|
(slib:load (in-vicinity (library-vicinity) "require.scm"))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue