Add support for "gzipped" files.
authorChris Hanson <org/chris-hanson/cph>
Thu, 15 Apr 1993 10:13:05 +0000 (10:13 +0000)
committerChris Hanson <org/chris-hanson/cph>
Thu, 15 Apr 1993 10:13:05 +0000 (10:13 +0000)
v7/src/edwin/dirunx.scm

index 2abef959049c9753d11ec07cb70151041e8c9163..b4ef528d940f666cdd2a341fa99005f7712bf9fb 100644 (file)
@@ -1,8 +1,8 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Id: dirunx.scm,v 1.1 1992/09/23 23:05:02 jinx Exp $
+;;;    $Id: dirunx.scm,v 1.2 1993/04/15 10:13:05 cph Exp $
 ;;;
-;;;    Copyright (c) 1992 Massachusetts Institute of Technology
+;;;    Copyright (c) 1992-93 Massachusetts Institute of Technology
 ;;;
 ;;;    This material was developed by the Scheme project at the
 ;;;    Massachusetts Institute of Technology, Department of
   "Change owner of this file."
   "sChange to Owner"
   (lambda (owner) (dired-change-line "chown" owner)))
-\f
+
 (define-command dired-compress
-  "Compress a file."
+  "Compress a file using gzip."
   '()
   (lambda ()
     (let ((pathname (dired-current-pathname)))
       (let ((directory (directory-pathname pathname)))
        (run-synchronous-process false false directory false
-                                (find-program "compress" directory)
+                                (find-program "gzip" directory)
                                 ""
                                 (->namestring pathname)))
       (dired-redisplay
        pathname
        (let ((old-type (pathname-type pathname)))
          (cond ((not old-type)
-                "Z")
-               ((string=? old-type "Z")
+                "z")
+               ((string=? old-type "z")
                 old-type)
                (else
-                (string-append old-type ".Z")))))))))
+                (string-append old-type ".z")))))))))
 
 (define-command dired-uncompress
-  "Uncompress a file."
+  "Uncompress a file using gunzip."
   '()
   (lambda ()
     (let ((pathname (dired-current-pathname)))
       (let ((directory (directory-pathname pathname)))
        (run-synchronous-process false false directory false
-                                (find-program "uncompress" directory)
+                                (find-program "gunzip" directory)
                                 ""
                                 (->namestring pathname)))
       (dired-redisplay
-       (if (and (pathname-type pathname)
-               (string=? (pathname-type pathname) "Z"))
+       (if (let ((type (pathname-type pathname)))
+            (and type
+                 (or (string=? "z" type)
+                     (string=? "Z" type))))
           (pathname-new-type pathname false)
           pathname)))))