;;; -*-Scheme-*-
;;;
-;;; $Id: dos.scm,v 1.24 1995/05/02 21:19:13 cph Exp $
+;;; $Id: dos.scm,v 1.25 1995/05/05 22:32:23 cph Exp $
;;;
;;; Copyright (c) 1992-95 Massachusetts Institute of Technology
;;;
(define (os/rmail-pop-procedure)
#f)
+(define (os/hostname)
+ (error "OS/HOSTNAME procedure unimplemented."))
+
(define (os/interprogram-cut string)
string push?
unspecific)
;;; -*-Scheme-*-
;;;
-;;; $Id: os2.scm,v 1.15 1995/05/04 07:06:12 cph Exp $
+;;; $Id: os2.scm,v 1.16 1995/05/05 22:32:33 cph Exp $
;;;
;;; Copyright (c) 1994-95 Massachusetts Institute of Technology
;;;
Otherwise, messages remain on the server and will be re-fetched later."
#t
boolean?)
+
+(define (os/hostname)
+ (if (not os2/cached-hostname)
+ (let ((buffer (temporary-buffer "*hostname*")))
+ (let ((status.reason
+ (run-synchronous-process #f (buffer-end buffer) #f #f
+ "hostname")))
+ (if (not (equal? status.reason '(EXITED . 0)))
+ (begin
+ (pop-up-buffer buffer)
+ (error "Error running HOSTNAME program:" status.reason))))
+ (set! os2/cached-hostname (string-trim (buffer-string buffer)))
+ (kill-buffer buffer)))
+ os2/cached-hostname)
+
+(define os2/cached-hostname #f)
+(add-event-receiver! event:after-restore
+ (lambda ()
+ (set! os2/cached-hostname #f)
+ unspecific))
\f
;;;; Generic Stuff
;;; These definitions are OS-independent and references to them should
;;; -*-Scheme-*-
;;;
-;;; $Id: unix.scm,v 1.49 1995/05/02 21:19:22 cph Exp $
+;;; $Id: unix.scm,v 1.50 1995/05/05 22:32:44 cph Exp $
;;;
;;; Copyright (c) 1989-95 Massachusetts Institute of Technology
;;;
(define (os/rmail-pop-procedure)
#f)
+(define os/hostname
+ (ucode-primitive full-hostname 0))
+
(define (os/ls-file-time-string time)
(let ((dt (decode-file-time time))
(ns (lambda (n m c) (string-pad-left (number->string n) m c))))