From: grzegorz@... (Grzegorz Chrupala) Date: 2003-06-18T23:14:39+09:00 Subject: Re: File.expand_path with files beginnig with ~ (tilde) on Windoze "J.Hawkesworth" wrote in message news:<8AD592BF2F0DD34E896E6283E53E8528DAAEF7@cally.talis.com>... I think I didn't make myself sufficiently clear. On Unix, we get the following, sensible behaviour: irb(main):004:0> File.expand_path("~grzegorz") => "/home/grzegorz" Indeed, "~someuser" expands as expected to the home directory of user "someuser". If "someuser" does not exist. an error is signalled, which again is reasonable, although the side-effect is that one cannot give to File.expand_path file names that _really_ start with "~" (which on Unix is not a big deal, since such files are uncommon). On Windoze, where the "~" convention is not used, in my opinion file names starting with "~" should _not_ be treated specially. When current directory is "C:/", I would expect File.expand_path("~$foobar") to return "C:/~$foobar", just like File.expand_path("foobar") returns "C:/foobar" An alternative would be to signal an error, but silently returning "~$foobar" doesn't make much sense. There is no reason on Windoze to use the Unix convention and treat file names starting with "~" any different that other files. What makes worse is the fact that many temp files created by M$ Office applications use names starting with "~$". I hope this clarifies matters a bit. Thougths? -- Grzegorz