From: Shashank Date Date: 2003-03-18T09:09:18+09:00 Subject: Re: name or label of a device/drive (os: win2000) I don't think Ruby has this built in since it is very Platform specific. So I suggest that you try wrting a Win32API wrapper function around GetVolumeInformation some what like this: ** WARNING: This is still not working quite right .. but you will get the idea. The most difficult part for me is to figure out how to pass parameters. For someone like Park Heesob, it is probably a piece of cake ! ################################# require 'Win32API' STDOUT.sync = true def getVolInfo(buf) params = [ 'P', #LPCTSTR lpRootPathName, 'P', #LPTSTR lpVolumeNameBuffer, 'L', #DWORD nVolumeNameSize, 'P', #LPDWORD lpVolumeSerialNumber, 'P', #LPDWORD lpMaximumComponentLength, 'P', #LPDWORD lpFileSystemFlags, 'P', #LPTSTR lpFileSystemNameBuffer, 'L' #DWORD nFileSystemNameSize ] returnValue = 'I' # BOOL fileSysNameBuf = "\0" * 260 # MAX_PATH dwSysFlags = ' ' * 8 getVolumeInformation = Win32API.new("kernel32", "GetVolumeInformation", params, returnValue) if getVolumeInformation.call(buf, 0, 0, 0, 0, dwSysFlags, fileSysNameBuf, 260) == 0 puts 'Error' else puts fileSysNameBuf end nil end p getVolInfo("C:") ################################# Hth, -- shanko "Frank Polscheit" wrote in message > I'm a newbie using ruby and want get the name of a device (os: Windows2000), > like the DOS command "label" shows as well as "dir" displays on the screen. > E.g. device C:\ is named "system disk" in my case. Using the class "Dir", I > can extract the complete directory tree including all files, but not the > label. Can somebody give me a hint how to solve this problem?