From: Lloyd Zusman Date: 2002-08-11T12:42:50+09:00 Subject: Re: Something that corresponds to Perl's -T and -B tests? nobu.nokada@softhome.net writes: > Hi, > > At Sun, 11 Aug 2002 11:41:00 +0900, > Lloyd Zusman wrote: >> I've written an extension to File::Stat which adds a textfile? and >> binaryfile? method. Each works pretty much the same as the file? >> and directory? methods of File::Stat. For example: > > Why not File::textfile? and so on? > Hello, and thank you for your feedback. Well, to me, the textfile? and binaryfile? methods seem closer in meaning to the file?, directory?, etc. methods of File::Stat. And if I'm not mistaken, the necessity to inspect the data inside of a file in order to determine whether it's a text file or binary file is OS-specific ... I believe that there are some OS's where this is just an attribute of a file that can be determined by making some sort of system call, in a similar way to which the inode, device, etc. are returned via the Unix stat() system call. So to me, textfile? and binaryfile? seem "stat-like", rather than "file-like" methods. But I don't have a strong objection to making this a method of File ... to me, this is just a matter of personal taste, and I am flexible. >> def initialize(arg) >> @item = arg > super >> end ??? "super" doesn't work in place of __old_initialize(arg) in my code. Neither does "super(arg)". What would the superclass be in this case? > Nobu Nakada -- Lloyd Zusman ljz@asfast.com