From: Luis Lavena Date: 2011-01-31T10:05:06+09:00 Subject: [ruby-core:35008] Re: file_expand_path performing unneeded IO operations on native Windows On Sun, Jan 30, 2011 at 9:39 PM, U.Nakamura wrote: > > Did you overlook lines from 3160-3164? > This call of FindFirstFile() regularizes the filename. > For instance, when the short filename is specified, this code > converts it into a true long filename. > This regularizing processing is chiefly needed from some security > reasons. > FindFirstFile is a globing operation and require two API calls (FindFirstFile and FindClose). If normalization of filename is required, then GetLongPathName [1] can be used instead, and is one API call. [1] http://msdn.microsoft.com/en-us/library/aa364980(v=vs.85).aspx -- Luis Lavena AREA 17 - Perfection in design is achieved not when there is nothing more to add, but rather when there is nothing more to take away. Antoine de Saint-Exup�ry