MCPcopy Index your code
hub / github.com/secdev/scapy / get

Method get

scapy/layers/smbclient.py:1654–1675  ·  view source on GitHub ↗

Retrieve a file -r: recursively download a directory

(self, file, _dest=None, _verb=True, *, r=False)

Source from the content-addressed store, hash-verified

1652
1653 @CLIUtil.addcommand(spaces=True, globsupport=True)
1654 def get(self, file, _dest=None, _verb=True, *, r=False):
1655 """
1656 Retrieve a file
1657 -r: recursively download a directory
1658 """
1659 if self._require_share():
1660 return
1661 if r:
1662 dirpar, dirname = self._parsepath(file)
1663 return file, self._getr(
1664 dirpar / dirname, # Remotely
1665 _root=self.localpwd / dirname, # Locally
1666 _verb=_verb,
1667 )
1668 else:
1669 fname = pathlib.PureWindowsPath(file).name
1670 # Write the buffer
1671 if _dest is None:
1672 _dest = self.localpwd / fname
1673 with _dest.open("wb") as fd:
1674 size = self._get_file(file, fd)
1675 return fname, size
1676
1677 @CLIUtil.addoutput(get)
1678 def get_output(self, info):

Callers 15

_getrMethod · 0.95
compile_filterFunction · 0.45
_reloadMethod · 0.45
setmodeMethod · 0.45
setmodulationMethod · 0.45
iterinterfacesMethod · 0.45
get_ip_from_nameFunction · 0.45
open_pcapFunction · 0.45
read_routes6Function · 0.45
sendMethod · 0.45
mainFunction · 0.45

Calls 5

_require_shareMethod · 0.95
_parsepathMethod · 0.95
_getrMethod · 0.95
_get_fileMethod · 0.95
openMethod · 0.45

Tested by

no test coverage detected