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

Method _parsepath

scapy/layers/smbclient.py:1335–1348  ·  view source on GitHub ↗

Parse a path. Returns the parent folder and file name

(self, arg, remote=True)

Source from the content-addressed store, hash-verified

1333 ]
1334
1335 def _parsepath(self, arg, remote=True):
1336 """
1337 Parse a path. Returns the parent folder and file name
1338 """
1339 # Find parent directory if it exists
1340 elt = (pathlib.PureWindowsPath if remote else pathlib.Path)(arg)
1341 eltpar = (pathlib.PureWindowsPath if remote else pathlib.Path)(".")
1342 eltname = elt.name
1343 if arg.endswith("/") or arg.endswith("\\"):
1344 eltpar = elt
1345 eltname = ""
1346 elif elt.parent and elt.parent.name or elt.is_absolute():
1347 eltpar = elt.parent
1348 return eltpar, eltname
1349
1350 def _fs_complete(self, arg, cond=None):
1351 """

Callers 3

_fs_completeMethod · 0.95
_lfs_completeMethod · 0.95
getMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected