# Directory path

**URL:** <https://www.ruby-forum.com/t/directory-path/179109>\
**Category:** Ruby\
**Created:** [November 17, 2009, 9:59pm UTC](https://www.ruby-forum.com/t/directory-path/179109 "2009-11-17T21:59:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![folke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/a9a28c/32.png) [@folke](https://www.ruby-forum.com/u/folke)\
**Post date:** [November 17, 2009, 9:59pm UTC](https://www.ruby-forum.com/t/directory-path/179109/1 "2009-11-17T21:59:58Z")

</div>

Hello, I hope someone can help me because I can’t figure out what’s  
wrong.

## Here’s a part of my code:

## directory = ‘/Volumes/Home Directory/Media/Film/TV-serier/Supernatural/SÃ¤song 5’ files = Dir.entries("#{directory}")

Works like a charm!

## Here’s another part of my code:

## File.rename(directory+files[2], directory+episodeList[2])

Doesn’t work!

I get the error: No such file or directory - No such file or directory -  
/Volumes/Home Directory/Media/Film/TV-serier/Supernatural/S???song  
5supernatural.s05e05.hdtv-lol.avi or /Volumes/Home  
Directory/Media/Film/TV-serier/Supernatural/S???song 5S05 E05 - Fallen  
Idol.avi (Errno::ENOENT)

What the hell is wrong? I’m using the exact same string, directory. I  
know this doesn’t work is because I’ve the letter “Ã¤” in the path. If I  
change to an “a” it’s works. But I can’t understand why, because it  
works perfectly with an “Ã¤” in the first part of my code.

Very grateful if someone have the solution to my problem!

---

<div class="post-metadata">

**Author:** ![folke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/a9a28c/32.png) [@folke](https://www.ruby-forum.com/u/folke)\
**Post date:** [November 17, 2009, 10:06pm UTC](https://www.ruby-forum.com/t/directory-path/179109/2 "2009-11-17T22:06:51Z")

</div>

On Tue, Nov 17, 2009 at 10:00 PM, Adam Folkesson  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ## Here’s a part of my code:
> 
> directory = ‘/Volumes/Home  
> Directory/Media/Film/TV-serier/Supernatural/SÃ¤song 5’  
> files = Dir.entries(“#{directory}”)

Note that directory is already a string, there’s no need to build  
another string to interpolate

```
Dir.entries(directory)

```

just works.

> /Volumes/Home Directory/Media/Film/TV-serier/Supernatural/S???song  
> 5supernatural.s05e05.hdtv-lol.avi or /Volumes/Home  
> Directory/Media/Film/TV-serier/Supernatural/S???song 5S05 E05 - Fallen  
> Idol.avi (Errno::ENOENT)
> 
> What the hell is wrong?

Could it be the case that you’re missing a slash between “SÃ¤song 5”  
and the filename?

---

<div class="post-metadata">

**Author:** ![folke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/a9a28c/32.png) [@folke](https://www.ruby-forum.com/u/folke)\
**Post date:** [November 17, 2009, 10:28pm UTC](https://www.ruby-forum.com/t/directory-path/179109/3 "2009-11-17T22:28:21Z")

</div>

> Could it be the case that you’re missing a slash between “SÃ¤song 5”  
> and the filename?

No, already tried that 😕

---

<div class="post-metadata">

**Author:** ![folke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/a9a28c/32.png) [@folke](https://www.ruby-forum.com/u/folke)\
**Post date:** [November 17, 2009, 10:30pm UTC](https://www.ruby-forum.com/t/directory-path/179109/4 "2009-11-17T22:30:34Z")

</div>

Adam Folkesson wrote:

> > Could it be the case that you’re missing a slash between “SÃ¤song 5”  
> > and the filename?
> 
> No, already tried that 😕

Really? 'Cause you _are_ missing a slash.

If not that, perhaps it’s an encoding issue on the Ã¤.

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![folke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/a9a28c/32.png) [@folke](https://www.ruby-forum.com/u/folke)\
**Post date:** [November 17, 2009, 10:36pm UTC](https://www.ruby-forum.com/t/directory-path/179109/5 "2009-11-17T22:36:17Z")

</div>

Marnen Laibow-Koser wrote:

> Adam Folkesson wrote:
> 
> > > Could it be the case that you’re missing a slash between “SÃ¤song 5”  
> > > and the filename?
> > 
> > No, already tried that 😕
> 
> Really? 'Cause you _are_ missing a slash.
> 
> If not that, perhaps it’s an encoding issue on the Ã¤.
> 
> ## Best,
> 
> Marnen Laibow-Koser  
> [http://www.marnen.org](http://www.marnen.org)  
> removed\_email\_address@domain.invalid

Yes I know, sorry. But in my “real” code there’s a slash, looks like  
this: directory = ‘/Volumes/Home  
Directory/Media/Film/TV-serier/Supernatural/SÃ¤song 5/’

---

<div class="post-metadata">

**Author:** ![folke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/a9a28c/32.png) [@folke](https://www.ruby-forum.com/u/folke)\
**Post date:** [November 17, 2009, 10:37pm UTC](https://www.ruby-forum.com/t/directory-path/179109/6 "2009-11-17T22:37:43Z")

</div>

Marnen Laibow-Koser wrote:

> If not that, perhaps it’s an encoding issue on the Ã¤.
> 
> ## Best,
> 
> Marnen Laibow-Koser  
> [http://www.marnen.org](http://www.marnen.org)  
> removed\_email\_address@domain.invalid

Yes, but why does it work here?: Dir.entries(“#{directory}”)
