- 追加された行はこの色です。
- 削除された行はこの色です。
* Write error: 入力/出力エラー [#lfb822c8]
ホストPC(CentOS 7)からNAS(cifsマウント)に対して,
dired-ranger-pasteでファイルコピーしようとすると,しばらく(10秒くらい?)emacsが
応答しなくなった後に以下のようなエラーが出力されます.
if: Write error: 入力/出力エラーです, /mnt/storage/temp/filename
ひとまず以下で回避していますが不安です(あと,ディレクトリコピーに対応してない).
ひとまず回避するために,原因と予想した(copy-file)関数をcpコマンドの(call-process)に置き換えていますが,不安です(あと,ディレクトリコピーに対応してない).
(defun dired-ranger-paste (arg)
"Copy the items from copy ring to current directory.
With raw prefix argument \\[universal-argument], do not remove
the selection from the stack so it can be copied again.
With numeric prefix argument, copy the n-th selection from the
copy ring."
(interactive "P")
(let* ((index (if (numberp arg) arg 0))
(data (ring-ref dired-ranger-copy-ring index))
(files (cdr data))
(target-directory (dired-current-directory))
(copied-files 0))
(--each files (when (file-exists-p it)
(if (file-directory-p it)
(copy-directory it target-directory)
(call-process "cp"
nil ;; stdin, nil=> /dev/null
"*Shell Command Output*" ;; destination
nil ;; display
;; args
"-v"
it
target-directory))
(cl-incf copied-files)))
(dired-ranger--revert-target ?P target-directory files)
(unless arg (ring-remove dired-ranger-copy-ring 0))
(message (format "Pasted %d/%d item%s from copy ring."
copied-files
(length files)
(if (> (length files) 1) "s" "")))))
原因は,おそらくC言語の組込み関数"emacs_full_write()"の内部で
writeがエラーを返しているためと予想します.ただ,返り値やerrnoを
調べるための再ビルドが面倒なので,上記で済ませています.
そのうちなんとかしたい..