# How to check if a file is in the folder "/admin"?

**URL:** <https://www.ruby-forum.com/t/how-to-check-if-a-file-is-in-the-folder-admin/120368>\
**Category:** Rails\
**Created:** [November 16, 2007, 9:15am UTC](https://www.ruby-forum.com/t/how-to-check-if-a-file-is-in-the-folder-admin/120368 "2007-11-16T09:15:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adistarmid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f14d63/32.png) [@adistarmid](https://www.ruby-forum.com/u/adistarmid)\
**Post date:** [November 16, 2007, 9:15am UTC](https://www.ruby-forum.com/t/how-to-check-if-a-file-is-in-the-folder-admin/120368/1 "2007-11-16T09:15:34Z")

</div>

I have a folder called “admin” to hold all of the administrator’s files.  
If I wanted to check if a file is inside the “/admin” folder (e.g.  
/admin/tasks/list.rhtml), how would I do it?

---

<div class="post-metadata">

**Author:** ![adistarmid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f14d63/32.png) [@adistarmid](https://www.ruby-forum.com/u/adistarmid)\
**Post date:** [November 16, 2007, 9:59am UTC](https://www.ruby-forum.com/t/how-to-check-if-a-file-is-in-the-folder-admin/120368/2 "2007-11-16T09:59:50Z")

</div>

On Nov 16, 2007, at 12:15 AM, Bob S. wrote:

> I have a folder called “admin” to hold all of the administrator’s  
> files.  
> If I wanted to check if a file is inside the “/admin” folder (e.g.  
> /admin/tasks/list.rhtml), how would I do it?

Look up the Ruby command File.exist?

– gw (www.railsdev.ws)
