From: caleb clausen Date: 2010-05-26T09:55:22+09:00 Subject: [ruby-core:30423] [Bug #3337] MS-DOS device names are identified as readable_real Issue #3337 has been updated by caleb clausen. I'm not certain that the above list is complete. Among other things, windows allows programs to define their own ms-dos device names using DefineDosDevice. It might be better (at least on windows) to query the system for the list of currently defined device names. It appears that windows ce allows device names which begin with \$device\ or \$bus\. Also, I'm puzzled by the fact that you require a / at the beginning of the device name, and allow . or / at the end. Microsoft's documentation only mentions allowing a : at the end. I think this might be a better regexp to use (wince devices still not checked here, tho): %r{\A(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])([./:]?\z)}i relevant pages on MSDN: INFO: Understanding Device Names and Symbolic Links http://support.microsoft.com/kb/235128 Defining an MS-DOS Device Name http://msdn.microsoft.com/en-us/library/aa363908(VS.85).aspx DefineDosDevice Function http://msdn.microsoft.com/en-us/library/aa363904(VS.85).aspx Device File Names (for windows ce) http://msdn.microsoft.com/en-us/library/aa447463.aspx QueryDosDevice Function (can return a list of known devices???) http://msdn.microsoft.com/en-us/library/aa365461(v=VS.85).aspx ---------------------------------------- http://redmine.ruby-lang.org/issues/show/3337 ---------------------------------------- http://redmine.ruby-lang.org