Windows bitbucket equivalent?

Hi all,

I’m working over somebody else’s Ruby code, and one of the methods used
during testing redirects all output to /dev/null. This is not a problem on
any flavor of UNIX or Linux that I’m familiar with, but on Windows XP it
raises a “ErrNo::ENOENT: No such file or directory” error. Is there an
equivalent file or means of temporarily disabling $stderr/$stdout/$defout?

Thanks,
Brian Wisti
brian@coolnamehere.com
http://coolnamehere.com/

Hi,

···

At Mon, 18 Nov 2002 09:45:48 +0900, Brian Wisti wrote:

I’m working over somebody else’s Ruby code, and one of the methods
used during testing redirects all output to /dev/null. This is not a
problem on any flavor of UNIX or Linux that I’m familiar with, but on
Windows XP it raises a “ErrNo::ENOENT: No such file or directory”
error. Is there an equivalent file or means of temporarily disabling
$stderr/$stdout/$defout?

nul


Nobu Nakada

Hi Nobu,

Hi,

I’m working over somebody else’s Ruby code, and one of the methods
used during testing redirects all output to /dev/null. This is not a
problem on any flavor of UNIX or Linux that I’m familiar with, but on
Windows XP it raises a “ErrNo::ENOENT: No such file or directory”
error. Is there an equivalent file or means of temporarily disabling
$stderr/$stdout/$defout?

nul

I feel so silly asking, but do you mean along the lines of this?

     File.open("nul", "w")

No, wait. That’d just make a file called “nul”, wouldn’t it? What am I
missing here? Is there a good online resource for me to study stuff like
this? Cross-platform programming is much easier when you know the platform
you’re crossing to.

Thanks,
Brian W

Brian Wisti
brian@coolnamehere.com
http://coolnamehere.com/

···

At 10:42 AM 11/18/2002 +0900, you wrote:

At Mon, 18 Nov 2002 09:45:48 +0900, >Brian Wisti wrote:

Original:
I feel so silly asking, but do you mean along the lines of this?

    File.open("nul", "w")

No, wait. That’d just make a file called “nul”, wouldn’t it? What am I missing
here? Is there a good online resource for me to study stuff like this?
Cross-platform programming is much easier when you know the platform you’re
crossing to.

Thanks,
Brian W

···

Reply:

I tried this script:

File.open( ‘nul’, ‘w’){ |f| 3.times{ |z| f.print z}}
File.open( ‘nulz’, ‘w’){ |f| 3.times{ |z| f.print z}}

It creates a file named “nulz” in the current directory, but does not create one
called “nul”.

James

Works like a charm. Thanks all around!

-Brian W

Brian Wisti
brian@coolnamehere.com
http://coolnamehere.com/

···

At 02:26 PM 11/19/2002 +0900, you wrote:

I tried this script:

File.open( ‘nul’, ‘w’){ |f| 3.times{ |z| f.print z}}
File.open( ‘nulz’, ‘w’){ |f| 3.times{ |z| f.print z}}

It creates a file named “nulz” in the current directory, but does not
create one
called “nul”.

I feel so silly asking, but do you mean along the lines of this?

    File.open("nul", "w")

No, wait. That’d just make a file called “nul”, wouldn’t it? What
am I missing
here?

No more so that File.open(“/dev/null”, “w”) would create a file named
/dev/null in unix, no.

···

=====

Yahoo IM: michael_s_campbell


Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site