Print

Print


@aperloff : I just pushed 9fd293c2124b86984a75944d39e553e722982d84, it exposes the chunked dirlist handling that has been implemented in cc83c0918f3835329846621b5f5e603ffa24f783

The chunked semantics is available only for asynchronous calls, here's an example:

```
from XRootD import client
from XRootD.client.flags import DirListFlags, OpenFlags, MkDirFlags, QueryCode
from XRootD.client import responses

import time

def callback(st, rsp, hosts):

  if st.ok:

    for ent in rsp:
      print ent # or do something else

    if st.code == responses.XRootDStatus.suDone:
      # this is the last chunk
      print 'We are done.'

    if st.code == responses.XRootDStatus.suPartial:
      # this happens if some of the requests failed, e.g. 
      # in case of recursive dirls client might fail listing
      # some subdirectories
      print 'We are done, but this is only partial result'

    if st.code == responses.XRootDStatus.suContinue:
      #more chunks will follow
      print 'We will continue with this callback'

fs = client.FileSystem('root://slc7-test:1094')
fs.dirlist( '/tmp', DirListFlags.RECURSIVE | DirListFlags.CHUNKED, 0, callback )

# make sure you wait until the callback gets the final response
time.sleep(3)
```

I hope this helps! Let me know if there's anything else you need or if the issue can be closed!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/xrootd/xrootd/issues/962#issuecomment-489548514

########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the XROOTD-DEV list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-DEV&A=1