(original) (raw)
Le mardi 15 juillet 2014, Ben Hoyt <benhoyt@gmail.com> a écrit :
Victor had one other question:
\> What happens to name and full\_name with followlinks=True?
\> Do they contain the name in the directory (name of the symlink)
\> or name of the linked file?
I would say they should contain the name and full path of the entry --
the symlink, NOT the linked file. They kind of have to, right,
otherwise they'd have to be method calls that potentially call the
system.
Sorry, I don't remember who but someone proposed to add the follow\_symlinks parameter in scandir() directly. If the parameter is added to methods, there is no such issue.
I like the compromise of adding an optional follow\_symlinks to is\_xxx() and stat() method. No need for .lstat().
Again: remove any garantee about the cache in the definitions of methods, instead copy the doc from os.path and os. Add a global remark saying that most methods don't need any syscall in general, except for symlinks (with follow\_symlinks=True).
Victor