/dev/null as a file-like object, or logging to nothing
Lawrence D'Oliveiro
ldo at geek-central.gen.new_zealand
Mon Sep 10 20:22:32 EDT 2007
More information about the Python-list mailing list
Mon Sep 10 20:22:32 EDT 2007
- Previous message (by thread): question on python syntax
- Next message (by thread): /dev/null as a file-like object, or logging to nothing
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
In message <uxv*tevUr at news.chiark.greenend.org.uk>, Sion Arrowsmith wrote: > Torsten Bronger <bronger at physik.rwth-aachen.de> wrote: >>Marc 'BlackJack' Rintsch writes: > >>> `os.devnull`? > >>Yes, but I wasn't really sure how portable it is, in particular, on >>Windows. > > 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. This has bitten Windows users more than once.
- Previous message (by thread): question on python syntax
- Next message (by thread): /dev/null as a file-like object, or logging to nothing
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list