[Python-Dev] Updates to PEP 471, the os.scandir() proposal

Victor Stinner victor.stinner at gmail.com
Thu Jul 10 02:23:17 CEST 2014


2014-07-09 17:26 GMT+02:00 Paul Moore <p.f.moore at gmail.com>:
> On 9 July 2014 16:05, Victor Stinner <victor.stinner at gmail.com> wrote:
>> The PEP says that DirEntry should mimic pathlib.Path, so I think that
>> DirEntry.is_dir() should work as os.path.isir(): if the entry is a
>> symbolic link, you should follow the symlink to get the status of the
>> linked file with os.stat().
>
> (...)
> As a Windows user with only a superficial understanding of how
> symlinks should behave, (...)

FYI Windows also supports symbolic links since Windows Vista. The
feature is unknown because it is restricted to the administrator
account. Try the "mklink" command in a terminal (cmd.exe) ;-)
http://en.wikipedia.org/wiki/NTFS_symbolic_link

... To be honest, I never created a symlink on Windows. But since it
is supported, you need to know it to write correctly your Windows
code.

(It's unrelated to "LNK" files.)

Victor


More information about the Python-Dev mailing list