Hello,

Reading File.realpath documentation:

/*
 * call-seq:
 *     File.realpath(pathname [, dir_string])  ->  real_pathname
 *
 *  Returns the real (absolute) pathname of _pathname_ in the actual
 *  filesystem not containing symlinks or useless dots.
 *
 *  If _dir_string_ is given, it is used as a base directory
 *  for interpreting relative pathname instead of the current directory.
 *
 *  All components of the pathname must exist when this method is
 *  called.
 */

And checking current behavior on Windows, every component of the path
is check for existence, so:

C:\Users\Luis>ruby -e "puts File.realpath('C:/foo')"
-e:1:in `realpath': No such file or directory - C:/foo (Errno::ENOENT)
        from -e:1:in `<main>'

C:\Users\Luis>ruby -e "puts File.realpath('C:/foo/bar')"
-e:1:in `realpath': No such file or directory - C:/foo (Errno::ENOENT)
        from -e:1:in `<main>'

Both trigger the same error, stating that C:/foo do not exist.

My question: can this behavior be changed for Windows?

Asking this because we are not reading and resolving symlink,
junctions or hardlinks in Ruby for Windows, so doing the entire
traversal and check seems a bit expensive (several stat() calls)

This means: build absolute path, expand if required, combine with
GetFileAttributesEx to check for existance.

Would this approach be acceptable?

Thank you.
-- 
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-Exupy