Maher4Ever / wdm

Windows Directory Monitor (WDM) is a threaded directories monitor for Windows.
https://rubygems.org/gems/wdm
MIT License
51 stars 15 forks source link

Network directory & network drives #1

Closed Elufimov closed 12 years ago

Elufimov commented 12 years ago

Will there be support for nуtwork directory & network drives? For now, monitoring this directory gives an error WDM::InvalidDirectoryError...

Maher4Ever commented 12 years ago

Absolutely! I'm just a bit busy these days, but I'll try to add the support in the next version.

Elufimov commented 12 years ago

It's cool! I'll be waiting :)

Maher4Ever commented 12 years ago

I just pushed some fixes to WDM which makes it work with network drives. It doesn't support password protected network drives at the moment. Can you try it? If it doesn't work, please provide all the details of your environment and usecase (the path to the network drive for example).

Elufimov commented 12 years ago

Ok! I try tomorrow at work.

Elufimov commented 12 years ago

Hello again! :) I tried it on virtual box shared folders. The logical drive D throw to guest as drive Z. Alt text

MONITOR_PATH = "Z:\\"
C:\Users\Test\Desktop>ruby monitor.rb
[DEBUG] (../../../../ext/wdm/wdm.c@35): Registering WDM with Ruby!
[DEBUG] (../../../../ext/wdm/rb_monitor.c@507): Registering WDM::Monitor with Ruby!
[DEBUG] (../../../../ext/wdm/rb_change.c@181): Registering WDM::Event with Ruby!
[DEBUG] (../../../../ext/wdm/rb_monitor.c@102): --------------------------------
[DEBUG] (../../../../ext/wdm/rb_monitor.c@103): Allocating a new monitor object!
[DEBUG] (../../../../ext/wdm/rb_monitor.c@104): --------------------------------
[DEBUG] (../../../../ext/wdm/rb_monitor.c@193): New path to watch: 'Z:\'
[DEBUG] (../../../../ext/wdm/rb_monitor.c@234): Watching directory: 'Z:\\'
Running the monitor...
[DEBUG] (../../../../ext/wdm/rb_monitor.c@434): Running the monitor!
[DEBUG] (../../../../ext/wdm/rb_monitor.c@327): Starting the monitoring thread!
[DEBUG] (../../../../ext/wdm/rb_monitor.c@315): Failed registering directory: 'Z'!
Maher4Ever commented 12 years ago

I'm not sure I understand the problem correctly. In the picture you show the D:\ drive, but in the script you pass Z:\. Are you running WDM inside the VM or outside of it?

Please open another issue and try to explain what you trying to achieve.

I'll close this issue as it seems the fix worked for you. If it didn't, I'll be happy to reopen it.