Home
Testing 1,2,3... - February 25th, 2005 [entries|archive|friends|userinfo]
djberg96

[ website | Sapphire ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Links
[Links:| Ruby Home RubyForge RAA comp.lang.ruby Ruby Documentation ]

February 25th, 2005

Adding constants to Dir [Feb. 25th, 2005|08:41 pm]
I released win32-dir tonight. This was a simple package - it's just a bunch of Windows specific constants added to the Dir class. So, if you need to get to the hosts file you can do something like this:
require "win32/dir"

hosts_file = Dir::WINDOWS + '\system32\drivers\etc\hosts'

Where Dir::WINDOWS could be 'C:\WINDOWS' or 'C:\WINNT' or whatever it was set to when the OS was installed. This is quite a bit easier than doing a bunch of File.exists? checks, eh?
link2 comments|post comment

navigation
[ viewing | February 25th, 2005 ]
[ go | Previous Day|Next Day ]

Advertisement