I've updated winnt_stat patch.
Against trunk.
https://gist.github.com/3248001
I've changed the original Dusan's patch to pass test-all.
I added `if (check_valid_dir(path)) return -1;`.
As you may know, original patch didn't pass `assert(!(File.directory?(@dir+"/...")))` in test_file_exhaustive.rb.
check_valid_dir was introduced due to the following issue.
And check_valid_dir was modified due to the following issue.
I changed check_valid_dir() less expensive way.
I found a test case of "Fall back to FindFirstFile".
192.168.0.3 is not existing host. The error of GetFileAttributesEx is ERROR_BAD_NETPATH.
But I'm not sure the reason of adding "Fall back to FindFirstFile".
Do you have any ideas?
And I noticed the following result is different between trunk and patched.
$ ruby -e "p File.stat('/')"
Patched ruby has atime, mtime and ctime, but trunk ruby doesn't.
It seems due to FindFirstFile doesn't get rootpath info.
# trunk
$ ruby -e "p File.stat('/')"
#<File::Stat dev=0x2, ino=0, mode=040755, nlink=1, uid=0, gid=0, rdev=0x2, size=0, blksize=nil, bloc
ks=nil, atime=1970-01-01 09:00:00 +0900, mtime=1970-01-01 09:00:00 +0900, ctime=1970-01-01 09:00:00
+0900>
I'm thinking to submit this patch to ruby-core. Please Let me know any opinions if you have.
Thank you.