comparison lisp/tar-mode.el @ 584:4cd7543be581

*** empty log message ***
author Jim Blandy <jimb@redhat.com>
date Mon, 16 Mar 1992 20:39:07 +0000
parents 31304a63a872
children 7cbd4fcd8b0f
comparison
equal deleted inserted replaced
583:3c0c1cd8428a 584:4cd7543be581
64 ;;; 64 ;;;
65 ;;; o In the directory listing, we don't show creation times because I don't 65 ;;; o In the directory listing, we don't show creation times because I don't
66 ;;; know how to print an arbitrary date, and I don't really want to have to 66 ;;; know how to print an arbitrary date, and I don't really want to have to
67 ;;; implement decode-universal-time. 67 ;;; implement decode-universal-time.
68 ;;; 68 ;;;
69 ;;; o There's code to update the datestamp of edited subfiles, but we set it
70 ;;; to zero because I don't know how to get the current time as an integer.
71 ;;;
72 ;;; o The code is less efficient that it could be - in a lot of places, I 69 ;;; o The code is less efficient that it could be - in a lot of places, I
73 ;;; pull a 512-character string out of the buffer and parse it, when I could 70 ;;; pull a 512-character string out of the buffer and parse it, when I could
74 ;;; be parsing it in place, not garbaging a string. Should redo that. 71 ;;; be parsing it in place, not garbaging a string. Should redo that.
75 ;;; 72 ;;;
76 ;;; o I'd like a command that searches for a string/regexp in every subfile 73 ;;; o I'd like a command that searches for a string/regexp in every subfile
106 if this is true, then editing and saving a tar file entry back into its 103 if this is true, then editing and saving a tar file entry back into its
107 tar file will update its datestamp. If false, the datestamp is unchanged. 104 tar file will update its datestamp. If false, the datestamp is unchanged.
108 You may or may not want this - it is good in that you can tell when a file 105 You may or may not want this - it is good in that you can tell when a file
109 in a tar archive has been changed, but it is bad for the same reason that 106 in a tar archive has been changed, but it is bad for the same reason that
110 editing a file in the tar archive at all is bad - the changed version of 107 editing a file in the tar archive at all is bad - the changed version of
111 the file never exists on disk. 108 the file never exists on disk.")
112
113 ## This doesn't work yet because there's no way to get the current time as
114 ## an integer - if this var is true, then editing a file sets its date to
115 ## December 31, 1969 (which happens to be what 0 encodes).")
116 109
117 110
118 111
119 ;;; First, duplicate some Common Lisp functions; I used to just (require 'cl) 112 ;;; First, duplicate some Common Lisp functions; I used to just (require 'cl)
120 ;;; but "cl.el" was messing some people up (also it's really big). 113 ;;; but "cl.el" was messing some people up (also it's really big).
976 ;; Maybe update the datestamp. 969 ;; Maybe update the datestamp.
977 (if (not tar-update-datestamp) 970 (if (not tar-update-datestamp)
978 nil 971 nil
979 (goto-char (+ header-start tar-time-offset)) 972 (goto-char (+ header-start tar-time-offset))
980 (delete-region (point) (+ (point) 12)) 973 (delete-region (point) (+ (point) 12))
981 (insert (format "%11o" 0)) ; ## oops - how to get it?? 974 (insert (format "%11o" (current-time)))
982 (insert ? )) 975 (insert ? ))
983 ;; 976 ;;
984 ;; compute a new checksum and insert it. 977 ;; compute a new checksum and insert it.
985 (let ((chk (checksum-tar-header-block 978 (let ((chk (checksum-tar-header-block
986 (buffer-substring header-start data-start)))) 979 (buffer-substring header-start data-start))))