21 lines
490 B
Scheme
21 lines
490 B
Scheme
(define-module (msg helpers)
|
|
#:use-module (ice-9 ftw)
|
|
#:use-module (ice-9 popen)
|
|
#:use-module (ice-9 rdelim)
|
|
#:use-module (system foreign)
|
|
#:export (directory-exists?
|
|
run-shell-command
|
|
start-command-in-background))
|
|
|
|
(define (directory-exists? path)
|
|
(catch 'system-error
|
|
(lambda ()
|
|
(stat path))
|
|
(lambda args #f)))
|
|
|
|
(define (run-shell-command command)
|
|
(let* ((port (open-input-pipe command))
|
|
(str (read-line port)))
|
|
;;(close-pipe port)
|
|
port))
|
|
|