# FileTest.identical? with IO

**URL:** <https://www.ruby-forum.com/t/filetest-identical-with-io/113842>\
**Category:** Development\
**Created:** [September 5, 2007, 2:42pm UTC](https://www.ruby-forum.com/t/filetest-identical-with-io/113842 "2007-09-05T14:42:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sheepman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepman](https://www.ruby-forum.com/u/sheepman)\
**Post date:** [September 5, 2007, 2:42pm UTC](https://www.ruby-forum.com/t/filetest-identical-with-io/113842/1 "2007-09-05T14:42:40Z")

</div>

e$B$3$s$P$s$Oe(B sheepman e$B$G$9!#e(B

FileTest.identical? e$B$K$O0z?t$H$7$Fe(B IO  
e$B%\*%V%8%’%/%H$bEO$9$3$H$,e(B  
e$B$G$-$^$9!#$7$+$7e(B IO  
e$B$,DL\>o%U%!%$%k$N$=$l$+$r8!::$7$F$$$^$;$s!#$G$9$N$G!"e(B  
e$B0J2\<$N$h$&$J$3$H$,5/$3$C$F$7$^$$$^$9!#e(B

$ cat t.rb  
p FileTest.identical?($stdin, $stdout)

$ ruby-1.8 -v t.rb  
ruby 1.8.6 (2007-09-01 patchlevel 5000) [i686-linux]  
true

e$B$3$l$O$3$&$$$&$b$N$J$N$G$7$g$&$+!#e(B

---

<div class="post-metadata">

**Author:** ![sheepman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepman](https://www.ruby-forum.com/u/sheepman)\
**Post date:** [September 5, 2007, 4:12pm UTC](https://www.ruby-forum.com/t/filetest-identical-with-io/113842/2 "2007-09-05T16:12:57Z")

</div>

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:31740] FileTest.identical? with IO”  
on Wed, 5 Sep 2007 21:41:51 +0900, sheepman  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

|FileTest.identical? e$B$K$O0z?t$H$7$Fe(B IO e$B%\*%V%8%'%/%H$bEO$9$3$H$,e(B  
|e$B$G$-$^$9!#$7$+$7e(B IO e$B$,DL\>o%U%!%$%k$N$=$l$+$r8!::$7$F$$$^$;$s!#$G$9$N$G!"e(B  
|e$B0J2\<$N$h$&$J$3$H$,5/$3$C$F$7$^$$$^$9!#e(B  
|  
|$ cat t.rb  
|p FileTest.identical?($stdin, $stdout)  
|  
|$ ruby-1.8 -v t.rb  
|ruby 1.8.6 (2007-09-01 patchlevel 5000) [i686-linux]  
|true  
|  
|e$B$3$l$O$3$&$$$&$b$N$J$N$G$7$g$&$+!#e(B

e$BG:$^$7$$$H$3$m$G$9$M!#e(B

% miniruby -e ‘p FileTest.identical?($stdin, $stdout)’  
true  
% miniruby -e ‘p FileTest.identical?($stdin, $stdout)’ \< /dev/null  
false

e$B$H$$$&7k2L$r8+$F$k$H$=$l$G$b$$$$$h$&$J5$$,$7$F$-$^$9!#e(B

---

<div class="post-metadata">

**Author:** ![sheepman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepman](https://www.ruby-forum.com/u/sheepman)\
**Post date:** [September 6, 2007, 3:42am UTC](https://www.ruby-forum.com/t/filetest-identical-with-io/113842/3 "2007-09-06T03:42:40Z")

</div>

e$B$5$H$&$U$\_$d$9e(B @ OSS e$B%F%/%N%m%8$G$9!#e(B

# Could not be delivered to [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

# As the remote domain doesnt exist.e$B$H8@$o$l$?$N$G:F;n9T!#2?8Ne(B?

At Wed, 5 Sep 2007 21:41:51 +0900,  
sheepman wrote:

> e$B$3$l$O$3$&$$$&$b$N$J$N$G$7$g$&$+!#e(B

e$B$=$&$$$&$b$N$8$c$J$$$G$7$g$&$+e(B?

$ ruby -e ‘p $stdin.stat; p $stdout.stat’

dev, ino, rdev e$B$,F10le(B (e$BF10l$NC\<Kv%G%P%$%9%U%!%$%ke(B)  
e$B$J$s$G$9$+$i!#e(B

$ ruby -e ‘p $stdin.stat; p $stdout.stat’ |tee /dev/null  
$ ruby -e ‘p $stdin.stat; p $stdout.stat’ \< /dev/null

---

<div class="post-metadata">

**Author:** ![sheepman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepman](https://www.ruby-forum.com/u/sheepman)\
**Post date:** [September 6, 2007, 5:23pm UTC](https://www.ruby-forum.com/t/filetest-identical-with-io/113842/4 "2007-09-06T17:23:20Z")

</div>

e$B$3$s$P$s$O!"e(Bsheepman e$B$G$9!#e(B

On Thu, 6 Sep 2007 10:42:15 +0900  
SATOH Fumiyasu [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> e$B$=$&$$$&$b$N$8$c$J$$$G$7$g$&$+e(B?
> 
> $ ruby -e ‘p $stdin.stat; p $stdout.stat’
> 
> dev, ino, rdev e$B$,F10le(B (e$BF10l$NC\<Kv%G%P%$%9%U%!%$%ke(B)  
> e$B$J$s$G$9$+$i!#e(B

e$B$J$k$[$I!“$o$+$j$^$7$?!#$”$j$,$H$&$4$6$$$^$9!#e(B
