| 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? |
|
|