# Getting absolute paths on files on filesystem

**URL:** <https://www.ruby-forum.com/t/getting-absolute-paths-on-files-on-filesystem/94653>\
**Category:** Rails\
**Created:** [May 10, 2006, 4:34am UTC](https://www.ruby-forum.com/t/getting-absolute-paths-on-files-on-filesystem/94653 "2006-05-10T04:34:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![samonderous](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3da27b/32.png) [@samonderous](https://www.ruby-forum.com/u/samonderous)\
**Post date:** [May 10, 2006, 4:34am UTC](https://www.ruby-forum.com/t/getting-absolute-paths-on-files-on-filesystem/94653/1 "2006-05-10T04:34:11Z")

</div>

Hi,

I’d like to be able to store the absolute path for a file so that I  
could  
use ![]() and give it the path to the file I’d like to  
display. I was wondering if there is an easy way to do this and whether  
there are any issues with this on Windows.

thanks in advance.

---

<div class="post-metadata">

**Author:** ![samonderous](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3da27b/32.png) [@samonderous](https://www.ruby-forum.com/u/samonderous)\
**Post date:** [May 10, 2006, 7:58am UTC](https://www.ruby-forum.com/t/getting-absolute-paths-on-files-on-filesystem/94653/2 "2006-05-10T07:58:07Z")

</div>

On 5/10/06, Sam D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

Check out the ‘uri’ and ‘pathname’ libraries that are part of Ruby’s  
stdlib.

IIRC, there are some issues on the latest version (1.8.4) with some  
Windows paths. Generally, workarounds are available.

-Alder

---

<div class="post-metadata">

**Author:** ![samonderous](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3da27b/32.png) [@samonderous](https://www.ruby-forum.com/u/samonderous)\
**Post date:** [May 10, 2006, 2:14pm UTC](https://www.ruby-forum.com/t/getting-absolute-paths-on-files-on-filesystem/94653/3 "2006-05-10T14:14:11Z")

</div>

Sam D. wrote:

> Hi,
> 
> I’d like to be able to store the absolute path for a file so that I  
> could  
> use ![]() and give it the path to the file I’d like to  
> display. I was wondering if there is an easy way to do this and whether  
> there are any issues with this on Windows.
> 
> thanks in advance.

AS far as I know, this won’t do you any good. What you need is not the  
absolute path, but the path in relation to the public directory.

–Al Evans
