Urabe Shyouhei wrote:
> C.E. Thornton wrote:
>   
>> Core,
>>
>> Expand path does not seem to handle directories
>> that start with "~" (tilde) character.
>>     
>
> Sorry if you've already noticed this, but have you read the
> documentation about File#expanf_path (see below)?  You are trying to
> expand a nonexistent user test's home directory, which generates an
> exception.
>
> File.expand_path(file_name [, dir_string] ) -> abs_file_name
>
> Converts a pathname to an absolute pathname. Relative paths are
> referenced from the current working directory of the process unless
> dir_string is given, in which case it will be used as the starting
> point. 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.
>
>   File.expand_path("~oracle/bin") #=> "/home/oracle/bin"
>
>
>   
Looking at the code I see that, However:

  When the path ~name it by definition IS NOT A VALID  pathname.

  FOR EXAMPLE:   if your home dir is "/home"

  In your home directory make the following directories
   "/home/test" and "/home/~test"

  Check these results:

   cd test     ==> /home/test
   cd ~test   ==> /home/~test      # Note this interpreted as "/home/~test"
                                                   # NOT /home/test !
   cd ~/test  ==> /home/test

   So as you can see -- It appears that Ruby mishandles path expansion!

-- 
Competency and chastity have much in common,
they both encompass their own punishment! 
 
-- C.E. Thornton -- Hawthorne Press --