From: Michel Demazure Date: 2011-12-20T00:52:52+09:00 Subject: [ruby-core:41720] Re: Feature : optional argument in File.join Luis Lavena wrote in post #1037331: > On Mon, Dec 19, 2011 at 6:09 AM, Michel Demazure > wrote: > Saying all this because File.join already supports multiple arguments > (you can splat an array) and adding checks for hash as last argument > might not be as good as we think. I agree with that. > I think will be better if you normalize the paths that you're using > with File.join prior it. Apparently, this does not work with Gtk::FileSelection, which does not recognize a path unless given the filename in the OS way. The doc says something of this kind (but only about encodings). See http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gtk%3A%3AFileSelection which says : filename=(filename) Sets a default path for the file requestor. If filename includes a directory path, then the requestor will open with that path as its current working directory. The encoding of filename is the on-disk encoding, which may not be UTF-8. See GLib.filename_from_utf8. I think I will just use the ordinary File.join, then gsub('/', '\') before giving the name to FileSelection. Thanks, _md -- Posted via http://www.ruby-forum.com/.