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

Method put

scapy/layers/smbclient.py:1722–1737  ·  view source on GitHub ↗

Upload a file

(self, file)

Source from the content-addressed store, hash-verified

1720
1721 @CLIUtil.addcommand(spaces=True)
1722 def put(self, file):
1723 """
1724 Upload a file
1725 """
1726 if self._require_share():
1727 return
1728 local_file = self.localpwd / file
1729 if local_file.is_dir():
1730 # Directory
1731 raise ValueError("put on dir not impl")
1732 else:
1733 fname = pathlib.Path(file).name
1734 with local_file.open("rb") as fd:
1735 size = self._send_file(fname, fd)
1736 self.ls_cache.clear()
1737 return fname, size
1738
1739 @CLIUtil.addcomplete(put)
1740 def put_complete(self, folder):

Callers 7

_runnerFunction · 0.80
pushMethod · 0.80
pushMethod · 0.80
pushMethod · 0.80
high_pushMethod · 0.80
pushMethod · 0.80
high_pushMethod · 0.80

Calls 4

_require_shareMethod · 0.95
_send_fileMethod · 0.95
openMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected