Forum: Ruby How do I get a name translation for a symbolic link inside Ruby?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
8e44b211865cd5915f2f883fd960b56d?d=identicon&s=25 Xeno Campanoli (Guest)
on 2009-03-17 21:14
(Received via mailing list)
So I have the results of the shell command:

ln -s 20090317 latest

But I only know about 'latest'.  How do I get the 20090317?  I know I
can do it
executing the shell and bringing in the string, but it seems there must
be a
method in Ruby, right?
0107ef1bc42d0626a706ca6af9a43060?d=identicon&s=25 Jos Backus (Guest)
on 2009-03-17 21:24
(Received via mailing list)
On Wed, Mar 18, 2009 at 05:10:30AM +0900, Xeno Campanoli wrote:
> So I have the results of the shell command:
>
> ln -s 20090317 latest
>
> But I only know about 'latest'.  How do I get the 20090317?

File.readlink
8e44b211865cd5915f2f883fd960b56d?d=identicon&s=25 Xeno Campanoli (Guest)
on 2009-03-17 21:32
(Received via mailing list)
Jos Backus wrote:
> On Wed, Mar 18, 2009 at 05:10:30AM +0900, Xeno Campanoli wrote:
>> So I have the results of the shell command:
>>
>> ln -s 20090317 latest
>>
>> But I only know about 'latest'.  How do I get the 20090317?
>
> File.readlink
>
Thank you.  Staring right at me on page 471 of my old pickaxe.

xc
This topic is locked and can not be replied to.