From: Mike Hall Date: 2002-04-11T00:13:27+09:00 Subject: Re: Addition to file.c (File.extension) Yukihiro Matsumoto wrote: > |YANAGAWA Kazuhisa wrote: > |> Uh, but that seems too dosish for me.... Nowadays there's so many > |> people who lives on Windows environments, and they don't doubt `.ext' > |> is called `extension', but also there's those who are familiar to more > |> generic `suffix'. > |I vote it. > "suffix" maybe better than "extension", but it too have same ambiguity. > Notice it's "File.suffix", not "FileName.suffix". This is a fun can of worms! Maybe we're going about this the wrong way? All I want to do is separate a generic file path into: - directory - basename - extension or suffix The first two currently exist as clones of UNIX shell commands. Convenient, but not always useful. What if we had a new Ruby method that did what we want? Maybe a version of File.split which returns [dir, root, suffix]? Then we don't have to name it! :-) (Although File.split always gets me, because I expect an array of directory components). FWIW: Tcl uses 'file dirname', 'file rootname', and 'file extension'. -- Mike Hall http://www.enteract.com/~mghall