MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / directoryPath

Function directoryPath

lib/core/common.py:2095–2110  ·  view source on GitHub ↗

Returns directory path for a given filepath >>> directoryPath('/var/log/apache.log') '/var/log' >>> directoryPath('/var/log') '/var/log'

(filepath)

Source from the content-addressed store, hash-verified

2093 return asciiTbl
2094
2095def directoryPath(filepath):
2096 """
2097 Returns directory path for a given filepath
2098
2099 >>> directoryPath('/var/log/apache.log')
2100 '/var/log'
2101 >>> directoryPath('/var/log')
2102 '/var/log'
2103 """
2104
2105 retVal = filepath
2106
2107 if filepath and os.path.splitext(filepath)[-1]:
2108 retVal = ntpath.dirname(filepath) if isWindowsDriveLetterPath(filepath) else posixpath.dirname(filepath)
2109
2110 return retVal
2111
2112def normalizePath(filepath):
2113 """

Callers 2

getManualDirectoriesFunction · 0.85
getAutoDirectoriesFunction · 0.85

Calls 1

isWindowsDriveLetterPathFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…