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

**URL:** <https://www.ruby-forum.com/t/how-do-i-get-a-name-translation-for-a-symbolic-link-inside-ruby/163161>\
**Category:** Ruby\
**Created:** [March 17, 2009, 9:14pm UTC](https://www.ruby-forum.com/t/how-do-i-get-a-name-translation-for-a-symbolic-link-inside-ruby/163161 "2009-03-17T21:14:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xeno\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/958977/32.png) [@Xeno\_C](https://www.ruby-forum.com/u/Xeno_C)\
**Post date:** [March 17, 2009, 9:14pm UTC](https://www.ruby-forum.com/t/how-do-i-get-a-name-translation-for-a-symbolic-link-inside-ruby/163161/1 "2009-03-17T21:14:05Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Xeno\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/958977/32.png) [@Xeno\_C](https://www.ruby-forum.com/u/Xeno_C)\
**Post date:** [March 17, 2009, 9:24pm UTC](https://www.ruby-forum.com/t/how-do-i-get-a-name-translation-for-a-symbolic-link-inside-ruby/163161/2 "2009-03-17T21:24:41Z")

</div>

On Wed, Mar 18, 2009 at 05:10:30AM +0900, Xeno C. 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

---

<div class="post-metadata">

**Author:** ![Xeno\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/958977/32.png) [@Xeno\_C](https://www.ruby-forum.com/u/Xeno_C)\
**Post date:** [March 17, 2009, 9:32pm UTC](https://www.ruby-forum.com/t/how-do-i-get-a-name-translation-for-a-symbolic-link-inside-ruby/163161/3 "2009-03-17T21:32:53Z")

</div>

Jos B. wrote:

> On Wed, Mar 18, 2009 at 05:10:30AM +0900, Xeno C. 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
