MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / resource_name

Function resource_name

src/commoncode/fileutils.py:195–201  ·  view source on GitHub ↗

Return the resource name (file name or directory name) from `path` which is the last path segment.

(path, force_posix=False)

Source from the content-addressed store, hash-verified

193
194
195def resource_name(path, force_posix=False):
196 """
197 Return the resource name (file name or directory name) from `path` which
198 is the last path segment.
199 """
200 _left, right = split_parent_resource(path, force_posix)
201 return right or ""
202
203
204def file_name(path, force_posix=False):

Callers 2

file_nameFunction · 0.85
splitextFunction · 0.85

Calls 1

split_parent_resourceFunction · 0.85

Tested by

no test coverage detected