A
Alan Davies
From the pickaxe book...
This isn't relevant on windows. Thus:
File.expand_path("~foo", "c:/somedir") -> "~foo"
where in fact it should return "c:/somedir/~foo".
Also:
File.expand_path("~", "c:/somedir")
throws up the error "`expand_path': couldn't find HOME environment --
expanding `~' (ArgumentError)"
It seems strange that the first example doesn't throw up the same error
that the second one does.
Can this functionality be disbaled on windows platforms in a future
version? Or at least add a parameter to the function call to disable it?
Alan.
File.expand_path( fileName [, aDirString ] ) -> fileName
The given pathname may start with a ``~'', which expands to the
process owner's home directory (the environment variable HOME must be
set correctly). "~ user" expands to the named user's home directory"
This isn't relevant on windows. Thus:
File.expand_path("~foo", "c:/somedir") -> "~foo"
where in fact it should return "c:/somedir/~foo".
Also:
File.expand_path("~", "c:/somedir")
throws up the error "`expand_path': couldn't find HOME environment --
expanding `~' (ArgumentError)"
It seems strange that the first example doesn't throw up the same error
that the second one does.
Can this functionality be disbaled on windows platforms in a future
version? Or at least add a parameter to the function call to disable it?
Alan.