From: "Berger, Daniel" Date: 2008-04-14T22:55:52+09:00 Subject: Re: cross-platform1: st1.dev == st2.dev and st1.ino == st2.ino consideredharmful > -----Original Message----- > From: Thomas.Enebo@Sun.COM [mailto:Thomas.Enebo@Sun.COM] > Sent: Sunday, April 13, 2008 12:16 PM > To: ruby-core@ruby-lang.org > Subject: cross-platform1: st1.dev == st2.dev and st1.ino == > st2.ino consideredharmful > > I propose we add something which makes this system-specific > code go away: > > st1 = stat(file1) > st2 = stat(file2) > st1.dev == st2.dev and st1.ino == st2.ino > > Perhaps: > > st1.same?(st2) > > Then people can get away from having to know any gory details > about filesystems. It should also reduce complexity of APIs > working with files in Ruby. Seem reasonable? File::Stat already mixes in Comparable, defining File::Stat#== to be true if the mtime is the same. I say redefine File::Stat#==, and get rid of Comparable, since I would have no idea what >, <, >=, <= and between? mean in the context of a File::Stat object, I've never seen them compared that way in practice, and I never use Comparable methods in File::Stat personally because, beyond simply not needing them, I would never be able to remember what the semantics are anyway. How File::Stat#== should be redefined exactly is open for debate. Regards, Dan This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.