Trans wrote:
> On Aug 17, 10:03 pm, Yukihiro Matsumoto <m... / ruby-lang.org> wrote:
>   
>> Hi,
>>
>> In message "Re: [ruby-core:18319] NEW Command:  absolute_path() --"
>>     on Sun, 17 Aug 2008 06:01:52 +0900, "C.E. Thornton" <ad... / hawthorne-press.com> writes:
>>
>> |I have created patches for both 1.8.7 and 1.9.0 trunk
>> |to implement the command 'absolute_path()'.
>>
>> |If there is anything else required for inclusion approval,
>> |please let me know.
>>
>> I am still thinking to decide if this is a creeping feature, or useful
>> addition (since it's VERY similar to a existing method).  I just want
>> to tell you you're not ignored at all.
>>     
>
> Why does the ~ prevent the expansion in File.expand_path?
>
>   File.expand_path('~oracle/bin')  #=> '~oracle/bin'
>
> Never noticed this before.
>
>                                                              7rans.
>
>
>   
Yeah, that got me too!

When expand_path() expands a path containing a leading tilde(~)
AND the directory name associated with it is a USER NAME in
the system it ASSUMES you specifying the home area of that user!

For example,  if I am in '/home/thornton/test' and it contains a dir
'~thornton' expand_path() returns '/home/thornton' NOT
'/home/thornton/test/~thornton'

I ran into fhis head first while writing a program to scan all
directories.

absolute_path() would ignore this wonderful feature and return
'/home/thornton/test/~thornton'.

Chuck T.

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