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

Method rm

scapy/layers/smbclient.py:1747–1766  ·  view source on GitHub ↗

Delete a file

(self, file)

Source from the content-addressed store, hash-verified

1745
1746 @CLIUtil.addcommand(spaces=True)
1747 def rm(self, file):
1748 """
1749 Delete a file
1750 """
1751 if self._require_share():
1752 return
1753 # Get pwd of the ls
1754 fpath = self.pwd / file
1755 self.smbsock.set_TID(self.current_tree)
1756 # Open file
1757 fileId = self.smbsock.create_request(
1758 self.normalize_path(fpath),
1759 type="file",
1760 mode="d",
1761 extra_create_options=self.extra_create_options,
1762 )
1763 # Close the file
1764 self.smbsock.close_request(fileId)
1765 self.ls_cache.clear()
1766 return fpath.name
1767
1768 @CLIUtil.addcomplete(rm)
1769 def rm_complete(self, file):

Callers

nothing calls this directly

Calls 6

_require_shareMethod · 0.95
normalize_pathMethod · 0.95
set_TIDMethod · 0.80
create_requestMethod · 0.80
close_requestMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected