Function: tramp-smb-wait-for-output
tramp-smb-wait-for-output is a byte-compiled function defined in
tramp-smb.el.gz.
Signature
(tramp-smb-wait-for-output VEC)
Documentation
Wait for output from smbclient command.
Removes smb prompt. Returns nil if an error message has appeared.
Source Code
;; Defined in /usr/src/emacs/lisp/net/tramp-smb.el.gz
;; We don't use timeouts. If needed, the caller shall wrap around.
(defun tramp-smb-wait-for-output (vec)
"Wait for output from smbclient command.
Removes smb prompt. Returns nil if an error message has appeared."
(with-current-buffer (tramp-get-connection-buffer vec)
(let ((p (get-buffer-process (current-buffer)))
(inhibit-read-only t))
;; Read pending output.
(while (not (re-search-forward tramp-smb-prompt nil t))
(while (tramp-accept-process-output p))
(goto-char (point-min)))
(tramp-message vec 6 "\n%s" (buffer-string))
;; Remove prompt.
(goto-char (point-min))
(when (re-search-forward tramp-smb-prompt nil t)
(goto-char (point-max))
(re-search-backward tramp-smb-prompt nil t)
(delete-region (point) (point-max)))
;; Return value is whether no error message has appeared.
(goto-char (point-min))
(not (re-search-forward tramp-smb-errors nil t)))))