Subject: bug#59545: 29.0.50; Eshell fails to redirect output of sourced eshell file

From: Eli Zaretskii <[email-masked]>
Date: Wed, 21 Dec 2022 21:26:48 +0200

> Date: Wed, 21 Dec 2022 10:48:18 -0800
> Cc: [email-masked], [email-masked],
>  Milan Zimmermann <[email-masked]>
> From: Jim Porter <[email-masked]>
> 
> However, I would have thought that you could write to NUL on MS Windows 
> without any special handling. The Emacs manual has this to say:
> 
> "[On MS Windows,] referencing any file whose name matches a DOS 
> character device, such as NUL or LPT1 or PRN or CON, with or without any 
> file-name extension, will always resolve to those character devices, in 
> any directory. Therefore, only use such file names when you want to use 
> the corresponding character device."
> 
> I'd expect that to mean that if you opened a buffer and tried to save it 
> as "NUL", it would just work, but instead I get:
> 
>    Write error: Bad file descriptor, c:/NUL

It's a bug, unrelated to the actual writing.  I fixed it now on the
emacs-29 branch.  You should be able now to save "NUL" on MS-Windows.