Hirokazu Yamamoto <ocean-c...@m2.ccsnet.ne.jp> added the comment:

There are some questions.

1. About my patch, I noticed it removed following code.
   Isn't this needed? I like clean code, but I don't want to
   break anything.

    /* Get WIN32_FIND_DATA structure for the path to determine if
       it is a symlink */
    if(info.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) {
        find_data_handle = FindFirstFileA(path, &find_data);
        if(find_data_handle != INVALID_HANDLE_VALUE) {
            if(find_data.dwReserved0 == IO_REPARSE_TAG_SYMLINK) {
                /* first clear the S_IFMT bits */
                result->st_mode ^= (result->st_mode & 0170000);
                /* now set the bits that make this a symlink */
                result->st_mode |= 0120000;
            }
            FindClose(find_data_handle);
        }
    }


    /* Set S_IFEXEC if it is an .exe, .bat, ... */
    dot = strrchr(path, '.');
    if (dot) {
        if (stricmp(dot, ".bat") == 0 || stricmp(dot, ".cmd") == 0 ||
            stricmp(dot, ".exe") == 0 || stricmp(dot, ".com") == 0)
            result->st_mode |= 0111;
    }

2. About current behavior. when os.stat() is used for junction
   (reparse point, but not simlink), returned information is
   about junction on XP or earlier, but about target folder on
   Vista or above. Is this intended bahavior?

Thank you.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10027>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to