in reply to Re: how can i send data to /dev/null ?
in thread how can i send data to /dev/null ?

/dev/null is a device, not a file. DO NOT try to open it for writing to as a file, especially if you're root. You don't want to overwrite the device link with a flat file.
  • Comment on Re^2: how can i send data to /dev/null ?

Replies are listed 'Best First'.
Re^3: how can i send data to /dev/null ?
by tirwhan (Abbot) on Dec 12, 2005 at 16:57 UTC
    Hmm?
    sh-2.05b$ stat /dev/null File: `/dev/null' Size: 0 Blocks: 0 IO Block: 4096 character +special file Device: 303h/771d Inode: 246087 Links: 1 Device type: 1 +,3 Access: (0666/crw-rw-rw-) Uid: ( 0/ root) Gid: ( 0/ roo +t) Access: 2005-06-18 10:16:06.000000000 +0200 Modify: 2005-06-18 10:16:06.000000000 +0200 Change: 2005-06-18 10:16:06.000000000 +0200 sh-2.05b$ whoami root sh-2.05b$ perl -e'open($null,">","/dev/null")or die "foo";print $null +"something" or die "bar"; close $null' sh-2.05b$ stat /dev/null File: `/dev/null' Size: 0 Blocks: 0 IO Block: 4096 character +special file Device: 303h/771d Inode: 246087 Links: 1 Device type: 1 +,3 Access: (0666/crw-rw-rw-) Uid: ( 0/ root) Gid: ( 0/ roo +t) Access: 2005-06-18 10:16:06.000000000 +0200 Modify: 2005-06-18 10:16:06.000000000 +0200 Change: 2005-06-18 10:16:06.000000000 +0200

    This is on Linux. Are there *NIXes where this behaves differently?


    Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -- Brian W. Kernighan