Hi all,
The Win32 Utils Team is happy to announce the first release of
win32-dir.
What is it?
···
===========
A series of extra constants for the Dir class that define special
folders on Win32 systems. That's it.
Like what?
For example, if you want the "Windows" directory on your system, you
could do this:
require "win32/dir"
p Dir::WINDOWS
That could return C:\WINDOWS, C:\WINNT, or whatever you set it to when
you installed Windows. This is much easier than doing a bunch of
File.exists? checks.
Where is it?
It's available on the RAA, or on the Win32 Utils project page at
http://www.rubyforge.org/projects/win32utils.
Enjoy!
The Win32 Utils Team
It's possible to make symlinks to directories in Windows.
I know you can do it using a directory with a special name including a GUID
like this:
Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}
This is a symlink to My Computer.{20D04FE0-3AEA-1069-A2D8-08002B30309D}
Sysinternals has a command-line tool to create and delete these:
http://www.sysinternals.com/ntw2k/source/misc.shtml#junction
Wouldn't the capability to make and inspect these be a neat addition to this
library?
Cheers,
Dave
···
"Daniel Berger" <djberg96@hotmail.com> wrote:
Hi all,
The Win32 Utils Team is happy to announce the first release of
win32-dir.
What is it?
A series of extra constants for the Dir class that define special
folders on Win32 systems. That's it.
Daniel Berger wrote:
Hi all,
The Win32 Utils Team is happy to announce the first release of
win32-dir.
What is it?
A series of extra constants for the Dir class that define special
folders on Win32 systems. That's it.
Like what?
For example, if you want the "Windows" directory on your system, you
could do this:
require "win32/dir"
p Dir::WINDOWS
Here's a bit more info in case that was too vague.
The list of constants (and a few examples):
Dir::ADMINTOOLS
Dir::COMMON_ADMINTOOLS
Dir::APPDATA
Dir::COMMON_APPDATA
Dir::COMMON_DOCUMENTS
Dir::COOKIES
Dir::HISTORY
Dir::INTERNET_CACHE
Dir::LOCAL_APPDATA
Dir::MYPICTURES
Dir::PERSONAL # Same as "My Documents"
Dir::PROGRAM_FILES # e.g. C:\Program Files
Dir::PROGRAM_FILES_COMMON
Dir::SYSTEM # e.g. C:\Windows\System32
Dir::WINDOWS
The following may or may not be defined on your system:
Dir::ALTSTARTUP
Dir::BITBUCKET
Dir::CDBURN_AREA
Dir::COMMON_ALTSTARTUP
Dir::COMMON_DESKTOPDIRECTORY
Dir::COMMON_FAVORITES
Dir::COMMON_MUSIC
Dir::COMMON_PICTURES
Dir::COMMON_PROGRAMS
Dir::COMMON_STARTMENU
Dir::COMMON_STARTUP
Dir::COMMON_TEMPLATES
Dir::COMMON_VIDEO
Dir::CONTROLS
Dir::DESKTOP
Dir::DESKTOPDIRECTORY
Dir::DRIVES
Dir::FAVORITES
Dir::FONTS # e.g. C:\WINDOWS\Fonts
Dir::INTERNET
Dir::MYDOCUMENTS
Dir::MYMUSIC
Dir::MYVIDEO
Dir::NETHOOD
Dir::NETWORK
Dir::PRINTERS
Dir::PRINTHOOD
Dir::PROFILE
Dir::PROFILES
Dir::PROGRAMS
Dir::RECENT
Dir::SENDTO
Dir::STARTMENU
Dir::STARTUP
Dir::TEMPLATES
Regards,
Dan
Dave Burt wrote:
> Hi all,
>
> The Win32 Utils Team is happy to announce the first release of
> win32-dir.
>
> What is it?
> ===========
> A series of extra constants for the Dir class that define special
> folders on Win32 systems. That's it.
It's possible to make symlinks to directories in Windows.
I know you can do it using a directory with a special name including
a GUID
like this:
Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}
This is a symlink to My
Computer.{20D04FE0-3AEA-1069-A2D8-08002B30309D}
Sysinternals has a command-line tool to create and delete these:
http://www.sysinternals.com/ntw2k/source/misc.shtml#junction
Wouldn't the capability to make and inspect these be a neat addition
to this
library?
Cheers,
Dave
Thanks Dave. I'll take a look.
Regards,
Dan
···
"Daniel Berger" <djberg96@hotmail.com> wrote:
To be even more basic, what would be the equivalent of the UNIX "˜/.my_app.rc"? File.join(Dir::APPDATA, "my_app.rc")?
Guillaume.
···
Le 26 févr. 05, à 02:05, Daniel Berger a écrit :
Here's a bit more info in case that was too vague.
The list of constants (and a few examples):
Dir::ADMINTOOLS
Dir::COMMON_ADMINTOOLS
Dir::APPDATA
Dir::COMMON_APPDATA
Dir::COMMON_DOCUMENTS
Dir::COOKIES
Dir::HISTORY
Dir::INTERNET_CACHE
Dir::LOCAL_APPDATA
Dir::MYPICTURES
Dir::PERSONAL # Same as "My Documents"
Dir::PROGRAM_FILES # e.g. C:\Program Files
Dir::PROGRAM_FILES_COMMON
Dir::SYSTEM # e.g. C:\Windows\System32
Dir::WINDOWS
The following may or may not be defined on your system:
Dir::ALTSTARTUP
Dir::BITBUCKET
Dir::CDBURN_AREA
Dir::COMMON_ALTSTARTUP
Dir::COMMON_DESKTOPDIRECTORY
Dir::COMMON_FAVORITES
Dir::COMMON_MUSIC
Dir::COMMON_PICTURES
Dir::COMMON_PROGRAMS
Dir::COMMON_STARTMENU
Dir::COMMON_STARTUP
Dir::COMMON_TEMPLATES
Dir::COMMON_VIDEO
Dir::CONTROLS
Dir::DESKTOP
Dir::DESKTOPDIRECTORY
Dir::DRIVES
Dir::FAVORITES
Dir::FONTS # e.g. C:\WINDOWS\Fonts
Dir::INTERNET
Dir::MYDOCUMENTS
Dir::MYMUSIC
Dir::MYVIDEO
Dir::NETHOOD
Dir::NETWORK
Dir::PRINTERS
Dir::PRINTHOOD
Dir::PROFILE
Dir::PROFILES
Dir::PROGRAMS
Dir::RECENT
Dir::SENDTO
Dir::STARTMENU
Dir::STARTUP
Dir::TEMPLATES
Regards,
Dan
"Guillaume Marcais" <guslist@free.fr> wrote in message:
To be even more basic, what would be the equivalent of the UNIX
"/.my_app.rc"? File.join(Dir::APPDATA, "my_app.rc")?
Some people use a dotfile:
File.join(Dir::PROFILE, ".irbrc")
Some people use a dotfile directory:
d = File.join(Dir::PROFILE, ".mysqlcc")
[File.join(d, 'mysqlcc.cfg'), File.join(d, 'history'), ...]
IMO, this is better:
d = File.join(Dir::APPDATA, "Application Name")
Or even:
d = File.join(Dir::APPDATA, "Vendor Name", "Application Name")
Cheers,
Dave
···
Le 26 févr. 05, à 02:05, Daniel Berger a écrit :