[Python] How to read metadata information from a file using SMB Protocol?

Discussão em 'Python' iniciado por Stack, Março 26, 2025.

  1. Stack

    Stack Membro Participativo

    I need to determine the last modification date of a file obtained via the SMB Protocol. I am using a machine running RHEL 7.5, Python 2.7.5, and SMB Protocol version 1.5.1.

    I tried the following, but it says that the attribute 'query_information' does not exist.

    current_file_open = Open(tree, full_file_path)
    current_file_open.create(
    desired_access=FilePipePrinterAccessMask.GENERIC_READ,
    file_attributes=0x80, # FILE_ATTRIBUTE_NORMAL
    share_access=1,
    create_disposition=CreateDisposition.FILE_OPEN,
    create_options=0,
    impersonation_level=2
    )

    file_details = current_file_open.query_information()

    Continue reading...

Compartilhe esta Página