On 27Jul2020 20:20, Termoregolato <waste@is.invalid> wrote: >Il 26/07/20 20:39, Dennis Lee Bieber ha scritto: >>Since symbolic links are essentially just short files containing the >>path to the eventual target file/directory, with an OS flag that the file >>is a link > >Yes, I use them massively to give to a lot of directories a kind of >order, depending on their contents. It's simple to see if link is >broken, but not if they're duplicate
Hmm. If you're scanning them all, you can at least cache the (dev,ino) of the link target. So broken is stat-failed. Duplicate is seen-this-(dev,ino)-before. You only need the stat, not to (for example) resolve the path the symlink becomes. You've probably thought of this already of cource. Cheers, Cameron Simpson <c...@cskk.id.au> -- https://mail.python.org/mailman/listinfo/python-list