#| -*-Scheme-*-
-$Id: ntprm.scm,v 1.27 1999/02/01 03:42:09 cph Exp $
+$Id: ntprm.scm,v 1.28 1999/02/25 22:15:45 cph Exp $
Copyright (c) 1992-1999 Massachusetts Institute of Technology
(trydir (get-environment-variable "HOME")))))
(%users-directory
(lambda ()
- (trydir (get-environment-variable "USERDIR"))))
- (%system-root-directory
- (lambda ()
- (let ((sysroot
- (or (trydir (get-environment-variable "SystemRoot"))
- (trydir (get-environment-variable "windir"))
- (trydir (get-environment-variable "winbootdir")))))
- (if (not sysroot)
- (error "Unable to find Windows system root."))
- (pathname-new-directory sysroot '(ABSOLUTE))))))
+ (trydir (get-environment-variable "USERDIR")))))
(set! current-user-name
(lambda ()
(and user-name
usersdir
(trydir (merge-pathnames user-name usersdir))))
- (let ((rootdir (%system-root-directory)))
+ (let ((rootdir (nt/system-root-directory)))
(or (and user-name
(trydir (merge-pathnames user-name rootdir)))
rootdir)))))))
(directory-pathname-as-file homedir))))
;; Look for USER-NAME in root directory of system
;; drive.
- (trydir (merge-pathnames user-name (%system-root-directory)))
+ (trydir (merge-pathnames user-name (nt/system-root-directory)))
;; OK, give up:
(error "Can't find user's home directory:" user-name))))))
(lambda (name)
(let ((value (get-environment-variable name)))
(and value
- (try-directory value))))))
- (or (try-variable "TEMP")
+ (try-directory value)))))
+ (try-system-directory
+ (lambda (directory)
+ (try-directory
+ (merge-pathnames directory (nt/system-root-directory))))))
+ (or (try-variable "TMPDIR")
+ (try-variable "TEMP")
(try-variable "TMP")
- (try-directory "/tmp")
- (try-directory "c:/")
+ (try-system-directory "\\temp")
+ (try-system-directory "\\tmp")
+ (try-system-directory "")
(try-directory ".")
- (try-directory "/")
(error "Can't find temporary directory.")))))
+(define (nt/system-root-directory)
+ (let ((sysroot
+ (or (trydir (get-environment-variable "SystemRoot"))
+ (trydir (get-environment-variable "windir"))
+ (trydir (get-environment-variable "winbootdir")))))
+ (if (not sysroot)
+ (error "Unable to find Windows system root."))
+ (pathname-new-directory sysroot '(ABSOLUTE))))
+
(define (os/file-end-of-line-translation pathname)
(if (let ((type (dos/fs-drive-type pathname)))
(or (string=? "NFS" (car type))
#| -*-Scheme-*-
-$Id: os2prm.scm,v 1.40 1999/02/01 03:42:01 cph Exp $
+$Id: os2prm.scm,v 1.41 1999/02/25 22:15:41 cph Exp $
Copyright (c) 1994-1999 Massachusetts Institute of Technology
(lambda (name)
(let ((value (get-environment-variable name)))
(and value
- (try-directory value))))))
- (or (try-variable "TEMP")
+ (try-directory value)))))
+ (try-system-directory
+ (lambda (directory)
+ (try-directory
+ (merge-pathnames directory (os2/system-root-directory))))))
+ (or (try-variable "TMPDIR")
+ (try-variable "TEMP")
(try-variable "TMP")
- (try-directory "\\tmp")
- (try-directory "c:\\")
+ (try-system-directory "\\temp")
+ (try-system-directory "\\tmp")
+ (try-system-directory "")
(try-directory ".")
- (try-directory "\\")
(error "Can't find temporary directory.")))))
+(define (os2/system-root-directory)
+ (let ((system.ini (get-environment-variable "SYSTEM_INI")))
+ (if (not (file-exists? system.ini))
+ (error "Unable to find OS/2 system.ini file:" system.ini))
+ (pathname-new-directory (directory-pathname system.ini) '(ABSOLUTE))))
+
(define-integrable os2/current-pid
(ucode-primitive current-pid 0))
\f
(trydir (get-environment-variable "HOME"))))
(%users-directory
(lambda ()
- (trydir (get-environment-variable "USERDIR"))))
- (%system-root-directory
- (lambda ()
- (let ((system.ini (get-environment-variable "SYSTEM_INI")))
- (if (not (file-exists? system.ini))
- (error "Unable to find OS/2 system.ini file:" system.ini))
- (pathname-new-directory (directory-pathname system.ini)
- '(ABSOLUTE))))))
+ (trydir (get-environment-variable "USERDIR")))))
(set! current-user-name
(lambda ()
(or (let ((usersdir (%users-directory)))
(and usersdir
(trydir (merge-pathnames user-name usersdir))))
- (let ((rootdir (%system-root-directory)))
+ (let ((rootdir (os2/system-root-directory)))
(or (trydir (merge-pathnames user-name rootdir))
rootdir)))))))
(directory-pathname-as-file homedir))))
;; Look for USER-NAME in root directory of system
;; drive.
- (trydir (merge-pathnames user-name (%system-root-directory)))
+ (trydir
+ (merge-pathnames user-name (os2/system-root-directory)))
;; OK, give up:
(error "Can't find user's home directory:" user-name))))))
\f
#| -*-Scheme-*-
-$Id: unxprm.scm,v 1.53 1999/02/01 03:42:13 cph Exp $
+$Id: unxprm.scm,v 1.54 1999/02/25 22:15:37 cph Exp $
Copyright (c) 1988-1999 Massachusetts Institute of Technology
(let ((value (get-environment-variable name)))
(and value
(try-directory value))))))
- (or (try-variable "TEMP")
+ (or (try-variable "TMPDIR")
+ (try-variable "TEMP")
(try-variable "TMP")
- (try-directory "/tmp")
+ (try-directory "/var/tmp")
(try-directory "/usr/tmp")
+ (try-directory "/tmp")
(error "Can't find temporary directory.")))))
\f
(define (file-attributes-direct filename)