msg-cli/msg/helpers.scm

22 lines
490 B
Scheme
Raw Normal View History

2023-11-20 09:05:07 -07:00
(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))