# Re: Getting path of current script

**URL:** <https://www.ruby-forum.com/t/re-getting-path-of-current-script/73463>\
**Category:** Ruby\
**Created:** [October 24, 2006, 8:11pm UTC](https://www.ruby-forum.com/t/re-getting-path-of-current-script/73463 "2006-10-24T20:11:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [October 24, 2006, 8:11pm UTC](https://www.ruby-forum.com/t/re-getting-path-of-current-script/73463/1 "2006-10-24T20:11:02Z")

</div>

From: Joe R. MUDCRAP-CE

> Is there a simpler way to get the absolute path of the current script?
> 
> path = File.dirname(File.expand\_path( **FILE** ))

Under some circumstances (like, you haven’t changed the working  
directory, and you can ensure that the working directory is the same as  
the script) Dir.pwd might be all you need, right?
