I just installed Emacs on Win8. However, sometimes, when I save buffer to the file, emacs will just say:
Write error: bad file descriptor, c:/Users/...
I tried different version of emacs, no help. If I restart the computer, the problem will be solved for a short time. Then is occurs again.
Any ideas ?
update
I run the command toggle-debug-on-error
, it gives me the following information:
Debugger entered--Lisp error: (file-error "Write error" "bad file descriptor" "c:/cygwin64/home/t-xins/workspace/codesnippet/html/main.js")
write-region(nil nil "c:/cygwin64/home/t-xins/workspace/codesnippet/html/main.js" nil t "c:/cygwin64/home/t-xins/workspace/codesnippet/html/main.js")
basic-save-buffer-2()
basic-save-buffer-1()
basic-save-buffer()
save-buffer(1)
call-interactively(save-buffer nil nil)
command-execute(save-buffer)
I observed that when my computer get awake after sleeping, the problem happens.
Things you might try to give us more information to help with this:
Run the function
toggle-debug-on-error
so that you can get a stack trace of the error next time it happens, which might give a clue as to what is happening.It is possible, but I'm not very sure of it, that it could be an encoding issue, in which case the following lines might fix it: