GNU bug report logs -
#5475
Archives with filenames with square brackets
Previous Next
Reported by: Juri Linkov <juri <at> jurta.org>
Date: Mon, 25 Jan 2010 17:58:02 UTC
Severity: normal
Done: Juri Linkov <juri <at> jurta.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> Until this option is implemented we should ignore stderr.
Hmm, discarding stderr is too bad. Better would be to redirect stderr
to a temporary file and display it when it contains error messages
(a pending patch):
=== modified file 'lisp/arc-mode.el'
--- lisp/arc-mode.el 2010-02-01 22:35:04 +0000
+++ lisp/arc-mode.el 2010-02-03 23:54:00 +0000
@@ -1076,11 +1099,11 @@ (defun archive-*-extract (archive name c
(archive-delete-local tmpfile)
success))
-(defun archive-extract-by-stdout (archive name command)
+(defun archive-extract-by-stdout (archive name command &optional stderr-file)
(apply 'call-process
(car command)
nil
- t
+ (if stderr-file (list t stderr-file) t)
nil
(append (cdr command) (list archive name))))
@@ -1999,7 +2022,65 @@ (defun archive-rar-exe-extract (archive
(if tmpbuf (kill-buffer tmpbuf))
(delete-file tmpfile))))
+(defun archive-7z-extract (archive name)
+ (let ((tmpfile (make-temp-file "7z-stderr")))
+ ;; 7z doesn't provide a `quiet' option to suppress non-essential
+ ;; stderr messages. So redirect stderr to a temp file and display it
+ ;; in the echo area when it contains error messages.
+ (prog1 (archive-extract-by-stdout
+ archive name archive-7z-extract tmpfile)
+ (with-temp-buffer
+ (insert-file-contents tmpfile)
+ (unless (search-forward "Everything is Ok" nil t)
+ (message (buffer-string)))
+ (delete-file tmpfile)))))
--
Juri Linkov
http://www.jurta.org/emacs/
This bug report was last modified 15 years and 37 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.