Check if symbolic link on Samba share with python

前端 未结 1 1247
清酒与你
清酒与你 2021-01-20 02:59

Can I know with Python from Windows if some files that I have access to on a Samba share are \"real\" files or symbolic links ? I tried os.path.islink but it re

相关标签:
1条回答
  • 2021-01-20 03:30

    I used pysmb to access samba shares from python and I found that according to the MS documentation the (symbolic) link was not taken into account in the protocol specification.

    I also tested with smbclient under Linux (Ubuntu) and there is no difference between links and directory.

    So this seems to be a limitation of the samba specification.

    PS: A project of mine aims to scan recursively a directory structure (samba share), which can loop forever in case of a symbolic link, since I cannot determine if it's a real directory or symbolic link.

    0 讨论(0)
提交回复
热议问题