# Re: Find.find or Dirwith spaces in filenames?

**URL:** <https://www.ruby-forum.com/t/re-find-find-or-dirwith-spaces-in-filenames/98058>\
**Category:** Ruby\
**Created:** [January 27, 2006, 9:23pm UTC](https://www.ruby-forum.com/t/re-find-find-or-dirwith-spaces-in-filenames/98058 "2006-01-27T21:23:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BergerS\_Daniel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc8723/32.png) [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Post date:** [January 27, 2006, 9:23pm UTC](https://www.ruby-forum.com/t/re-find-find-or-dirwith-spaces-in-filenames/98058/1 "2006-01-27T21:23:27Z")

</div>

> -----Original Message-----  
> From: Ezra Z. [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]  
> Sent: Friday, January 27, 2006 1:03 PM  
> To: ruby-talk ML  
> Subject: Find.find or Dir[\*\*/\*] with spaces in filenames?

> ```
> @count_conv = 0
> puts "Converted to #{@scale}x#{@scale} #{file}..."
> end
> @count_conv += 1
> end
> end
> end
> @log_file << "\n\n#{@count_conv} logos were converted to  
> 
> ```
> 
> correctly sized gifs.\n\n\n"  
> end

This looks ok to me. File.find yields files and directories with spaces  
without any problem. Perhaps the problem is with the “convert”  
function.

The easiest workaround (if that’s the case) is to rename the file before  
passing it to convert, replacing spaces with underscores.

Otherwise, you’ll have to be more specific about the error you’re  
getting.

Regards,

Dan

---

<div class="post-metadata">

**Author:** ![BergerS\_Daniel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc8723/32.png) [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Post date:** [January 27, 2006, 9:32pm UTC](https://www.ruby-forum.com/t/re-find-find-or-dirwith-spaces-in-filenames/98058/2 "2006-01-27T21:32:31Z")

</div>

Daniel-

```
Doh! Your of course correct. I wasn't looking in the right place to

```

see what I was doing. This will let me finish what I need to do.

Thanks  
-Ezra
