/dev/null as a file-like object, or logging to nothing

Asun Friere afriere at yahoo.co.uk
Tue Sep 11 02:53:10 CEST 2007


On Sep 11, 10:22 am, Lawrence D'Oliveiro <l... at geek-
central.gen.new_zealand> wrote:
> In message <uxv*te... at news.chiark.greenend.org.uk>, Sion Arrowsmith wrote:
>
> > Torsten Bronger  <bron... at physik.rwth-aachen.de> wrote:
>
> > Windows has a NUL: device which behaves like /dev/null .
>
> It's not a device, it's a reserved file name. Or rather, a reserved file
> name prefix: any attempt to open a file name beginning with NUL, e.g.
> NUL.DAT, will cause your output to disappear into a black hole.

Yes Windows and its whacky error messages.  While trying to save a
Word doc as 'NUL.doc' I got this error message: "The file name
'NUL.doc' is a reserved device name."  It's no wonder some might
mistake it for a device!





More information about the Python-list mailing list