MCPcopy Index your code
hub / github.com/python/cpython / dir

Method dir

Lib/ftplib.py:550–563  ·  view source on GitHub ↗

List a directory in long form. By default list current directory to stdout. Optional last argument is callback function; all non-empty arguments before it are concatenated to the LIST command. (This *should* only be used for a pathname.)

(self, *args)

Source from the content-addressed store, hash-verified

548 return files
549
550 def dir(self, *args):
551 '''List a directory in long form.
552 By default list current directory to stdout.
553 Optional last argument is callback function; all
554 non-empty arguments before it are concatenated to the
555 LIST command. (This *should* only be used for a pathname.)'''
556 cmd = 'LIST'
557 func = None
558 if args[-1:] and not isinstance(args[-1], str):
559 args, func = args[:-1], args[-1]
560 for arg in args:
561 if arg:
562 cmd = cmd + (' ' + arg)
563 self.retrlines(cmd, func)
564
565 def mlsd(self, path="", facts=[]):
566 '''List a directory in a standardized format by using MLSD

Callers 2

testFunction · 0.95
test_dirMethod · 0.80

Calls 1

retrlinesMethod · 0.95

Tested by 1

test_dirMethod · 0.64