From: Lloyd Zusman Date: 2002-08-09T23:24:41+09:00 Subject: Re: Getting the file name from a File::Stat object? GOTO Kentaro writes: > At Fri, 9 Aug 2002 22:46:32 +0900, > Lloyd Zusman wrote: > >> Is there a way to get the file name from a File::Stat object? > > Only way is to search files which have the inode number File::Stat#ino. > File::Stat represents status of an inode and an inode may be associated > many file names. > > [ ... ] Thank you very much. I was hoping that I didn't have to do it via inodes. Oh well ... [sigh] Actually, I just want to retrieve the initial argument, exactly as specified. For that purpose, I know I can always use a subclass, like this: class MyStat < File::Stat attr_reader :item def initialize(arg) @item = arg super(arg) end end stat = MyStat.new("file.name") p stat.item output: "file.name" But I was hoping I didn't need to rely on a subclass, so that I could also get the same behavior from File.stat, etc. Like I said above ... oh well ... Thanks again. -- Lloyd Zusman ljz@asfast.com