Skip to content

File.null

Daniel Berger edited this page Oct 23, 2018 · 3 revisions

The File.null method returns the null device (bitbucket) for your particular system. There's also the File.null_device alias.

# Examples:

# MS Windows

File.null # => 'NUL'

# Linux (and most Unixy operating systems)

File.null # => '/dev/null'

Note that this method is no longer necessary if you are using a recent version of Ruby, which now has the IO::NULL constant.

Clone this wiki locally