Skip to content

how to list other dir? #7

Description

@xingfengf21

this is my fucking code

portmap initialization

portmap = Portmap(host, timeout=3600)
print(portmap.connect())

mount initialization

mnt_port = portmap.getport(Mount.program, Mount.program_version)
mount = Mount(host=host, port=mnt_port, timeout=3600, auth=auth)
mount.connect()

do mount

mnt_res =mount.mnt(mount_path, auth=auth)

if mnt_res["status"] == MNT3_OK:
root_fh =mnt_res["mountinfo"]["fhandle"]

print('root_fh',root_fh, type(root_fh))
try:
    nfs_port =portmap.getport(NFS_PROGRAM, NFS_V3)
    # nfs actions
    nfs3 =NFSv3(host, nfs_port, 3600, auth=auth)
    nfs3.connect()
    lookup_res = nfs3.readdirplus(root_fh+b'/a',auth=auth) #
    print(lookup_res)
except Exception as e:
    print(e)
finally:
    if nfs3:
        nfs3.disconnect()
    # mount.umnt(mount_path)
    mount.disconnect()
    portmap.disconnect()

else:
mount.disconnect()
portmap.disconnect()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions