#| -*-Scheme-*-
-$Id: dosprm.scm,v 1.30 1995/10/18 05:09:08 cph Exp $
+$Id: dosprm.scm,v 1.31 1995/10/23 06:39:32 cph Exp $
Copyright (c) 1992-95 Massachusetts Institute of Technology
((ucode-primitive directory-delete 1)
(->namestring (directory-pathname-as-file (merge-pathnames name)))))
+(define (os/file-end-of-line-translation pathname)
+ pathname
+ "\r\n")
+
(define (os/default-end-of-line-translation)
"\r\n")
#| -*-Scheme-*-
-$Id: dospth.scm,v 1.30 1995/10/18 05:00:30 cph Exp $
+$Id: dospth.scm,v 1.31 1995/10/23 06:38:26 cph Exp $
Copyright (c) 1992-95 Massachusetts Institute of Technology
(hook/dos/end-of-line-string pathname))
(define (default/dos/end-of-line-string pathname)
- pathname ; ignored
- (os/default-end-of-line-translation))
\ No newline at end of file
+ (os/file-end-of-line-translation pathname))
\ No newline at end of file
#| -*-Scheme-*-
-$Id: os2prm.scm,v 1.18 1995/07/07 06:37:24 cph Exp $
+$Id: os2prm.scm,v 1.19 1995/10/23 06:38:35 cph Exp $
Copyright (c) 1994-95 Massachusetts Institute of Technology
(try-directory "\\")
(error "Can't find temporary directory.")))))
-(define (os2/fs-long-filenames? pathname)
- (not (string-ci=? "fat"
- ((ucode-primitive drive-type 1)
- (pathname-device pathname)))))
-
(define-integrable os2/current-pid
(ucode-primitive current-pid 0))
(pathname-as-directory (merge-pathnames directory))
user-name)))))
"\\"))
+\f
+(define (os2/fs-drive-type pathname)
+ (let ((type ((ucode-primitive drive-type 1) (pathname-device pathname))))
+ (let ((colon (string-find-next-char type #\:)))
+ (if colon
+ (cons (string-head type colon) (string-tail type (fix:+ colon 1)))
+ (cons type "")))))
+
+(define (os2/fs-long-filenames? pathname)
+ (not (string-ci=? "fat" (car (os2/fs-drive-type pathname)))))
+
+(define (os/file-end-of-line-translation pathname)
+ (let ((type (os2/fs-drive-type pathname)))
+ ;; "ext2" is the Linux ext2 file-system driver. "NFS" is the IBM
+ ;; TCP/IP NFS driver, which we further qualify by examining the
+ ;; mount info -- if the directory starts with a "/", we assume
+ ;; that it is a unix system.
+ (if (or (string=? "ext2" (car type))
+ (and (string=? "NFS" (car type))
+ (let* ((mount (cdr type))
+ (colon (string-find-next-char mount #\:)))
+ (and colon
+ (fix:< (fix:+ colon 1) (string-length mount))
+ (char=? #\/ (string-ref mount (fix:+ colon 1)))))))
+ #f
+ "\r\n")))
(define (os/default-end-of-line-translation)
"\r\n")
#| -*-Scheme-*-
-$Id: unxprm.scm,v 1.39 1995/10/18 05:02:57 cph Exp $
+$Id: unxprm.scm,v 1.40 1995/10/23 06:39:22 cph Exp $
Copyright (c) 1988-95 Massachusetts Institute of Technology
((ucode-primitive directory-delete 1)
(->namestring (directory-pathname-as-file (merge-pathnames name)))))
+(define (os/file-end-of-line-translation pathname)
+ pathname
+ #f)
+
(define (os/default-end-of-line-translation)
#f)
\f