# Dir.glob of mapped drive

**URL:** <https://www.ruby-forum.com/t/dir-glob-of-mapped-drive/108878>\
**Category:** Ruby\
**Created:** [July 8, 2007, 7:13pm UTC](https://www.ruby-forum.com/t/dir-glob-of-mapped-drive/108878 "2007-07-08T19:13:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikec](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/977dab/32.png) [@mikec](https://www.ruby-forum.com/u/mikec)\
**Post date:** [July 8, 2007, 7:13pm UTC](https://www.ruby-forum.com/t/dir-glob-of-mapped-drive/108878/1 "2007-07-08T19:13:56Z")

</div>

I’ve mapped a Z: drive on my PC from my mac, but whenever I try the  
following script from the command line, it works fine, but when I try to  
execute it within Eclipse with the Ruby Development Tools plugin  
installed, it just terminates immediately with no output.

require ‘exifr’  
Dir.glob(“Z:/2007/07/02/\*.JPG”).each do |filename|  
jpg = EXIFR::JPEG.new(filename)  
print “#{filename}: \n”  
jpg.exif.to\_hash.each do |key,val|  
print “\t#{key}=#{val}\n”  
end  
end

Would anyone happen to know why that is? I can work around the issue by  
running from the command line, but I’m embarrassed to admit how long I  
spent trying to figure out what was wrong with my code, when, in fact it  
works fine from the command line.

---

<div class="post-metadata">

**Author:** ![mikec](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/977dab/32.png) [@mikec](https://www.ruby-forum.com/u/mikec)\
**Post date:** [July 9, 2007, 5:08pm UTC](https://www.ruby-forum.com/t/dir-glob-of-mapped-drive/108878/2 "2007-07-09T17:08:17Z")

</div>

On Jul 8, 11:13 am, Mike C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> print "\t#{key}=#{val}\n"
> end
> 
> ```
> 
> end
> 
> Would anyone happen to know why that is? I can work around the issue by  
> running from the command line, but I’m embarrassed to admit how long I  
> spent trying to figure out what was wrong with my code, when, in fact it  
> works fine from the command line.

Just for kicks, what happens if you replace the forward slashes with  
backslashes? And is it possible there’s some sort of interaction  
between exifr and Eclipse happening?

Regards,

Dan

---

<div class="post-metadata">

**Author:** ![mikec](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/977dab/32.png) [@mikec](https://www.ruby-forum.com/u/mikec)\
**Post date:** [July 10, 2007, 1:19am UTC](https://www.ruby-forum.com/t/dir-glob-of-mapped-drive/108878/3 "2007-07-10T01:19:07Z")

</div>

Yeah, I thought of that and tried it both ways, same result…

---

<div class="post-metadata">

**Author:** ![mikec](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/977dab/32.png) [@mikec](https://www.ruby-forum.com/u/mikec)\
**Post date:** [July 10, 2007, 1:48pm UTC](https://www.ruby-forum.com/t/dir-glob-of-mapped-drive/108878/4 "2007-07-10T13:48:22Z")

</div>

I’ve got to get to work, so I’ll try some of these later… I’ve not  
had trouble in the past with a lot of ruby code executing from within  
Eclipse. and have had EXIF code work as long as I was hitting the local  
file system.

I noticed a similar problem last night when trying to use plist to read  
the AlbumData.xml from my mac (returned nil from within ecipse, but  
worked fine from the command line).

It’s looking like the common thread is in trying to read non-local files  
from within eclipse (though I can’t see why that should be a problem)

---

<div class="post-metadata">

**Author:** ![mikec](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/977dab/32.png) [@mikec](https://www.ruby-forum.com/u/mikec)\
**Post date:** [July 10, 2007, 6:32am UTC](https://www.ruby-forum.com/t/dir-glob-of-mapped-drive/108878/5 "2007-07-10T06:32:33Z")

</div>

Hi,

At Mon, 9 Jul 2007 02:13:18 +0900,  
Mike C. wrote in [ruby-talk:258362]:

> I’ve mapped a Z: drive on my PC from my mac, but whenever I try the  
> following script from the command line, it works fine, but when I try to  
> execute it within Eclipse with the Ruby Development Tools plugin  
> installed, it just terminates immediately with no output.

If it works fine when run from the command line, it should not  
be concerned with Dir.glob.

Does more simple code work?

puts Dir.glob(“Z:/2007/07/02/\*.JPG”)

or

require ‘exifr’  
p EXIFR::JPEG

or

require ‘exifr’  
p EXIFR::JPEG.new()
