;;; -*-Scheme-*-
;;;
-;;; $Id: dos.scm,v 1.39 1996/10/07 18:51:12 cph Exp $
+;;; $Id: dos.scm,v 1.40 1996/10/09 15:44:28 cph Exp $
;;;
;;; Copyright (c) 1992-96 Massachusetts Institute of Technology
;;;
;; Not sure if this is right.
(list "/c" command))
-(define (os/directory-list directory)
- (os/directory-list-completions directory ""))
-
-(define (os/directory-list-completions directory prefix)
- (let ((plen (string-length prefix)))
- (let loop ((pathnames (directory-read (pathname-as-directory directory))))
- (if (null? pathnames)
- '()
- (let ((filename (file-namestring (car pathnames))))
- (if (and (fix:>= (string-length filename) plen)
- (string-ci=? prefix (substring filename 0 plen)))
- (cons filename (loop (cdr pathnames)))
- (loop (cdr pathnames))))))))
-
(define (os/set-file-modes-writable! pathname)
(set-file-modes! pathname
(fix:andc (file-modes pathname) nt-file-mode/read-only)))
;;; -*-Scheme-*-
;;;
-;;; $Id: dosfile.scm,v 1.7 1996/04/24 02:19:30 cph Exp $
+;;; $Id: dosfile.scm,v 1.8 1996/10/09 15:44:37 cph Exp $
;;;
;;; Copyright (c) 1994-96 Massachusetts Institute of Technology
;;;
(string-set! result 0 #\$)
result)
filename)))
+
+(define (os/directory-list directory)
+ (let ((channel (directory-channel-open directory)))
+ (let loop ((result '()))
+ (let ((name (directory-channel-read channel)))
+ (if name
+ (loop (cons (begin (string-downcase! name) name) result))
+ (begin
+ (directory-channel-close channel)
+ result))))))
+
+(define (os/directory-list-completions directory prefix)
+ (let ((channel (directory-channel-open directory)))
+ (let loop ((result '()))
+ (let ((name (directory-channel-read-matching channel prefix)))
+ (if name
+ (loop (cons (begin (string-downcase! name) name) result))
+ (begin
+ (directory-channel-close channel)
+ result))))))
\f
;;;; Backup and Auto-Save Filenames
;;; -*-Scheme-*-
;;;
-;;; $Id: os2.scm,v 1.33 1996/10/02 17:00:22 cph Exp $
+;;; $Id: os2.scm,v 1.34 1996/10/09 15:44:46 cph Exp $
;;;
;;; Copyright (c) 1994-96 Massachusetts Institute of Technology
;;;
(define (os/form-shell-command command)
(list "/c" command))
-(define (os/directory-list directory)
- (let ((channel (directory-channel-open directory)))
- (let loop ((result '()))
- (let ((name (directory-channel-read channel)))
- (if name
- (loop (cons (begin (string-downcase! name) name) result))
- (begin
- (directory-channel-close channel)
- result))))))
-
-(define (os/directory-list-completions directory prefix)
- (let ((channel (directory-channel-open directory)))
- (let loop ((result '()))
- (let ((name (directory-channel-read-matching channel prefix)))
- (if name
- (loop (cons (begin (string-downcase! name) name) result))
- (begin
- (directory-channel-close channel)
- result))))))
-
(define (os/set-file-modes-writable! pathname)
(set-file-modes! pathname
(fix:andc (file-modes pathname) os2-file-mode/read-only)))