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

Function file_base_name

src/commoncode/fileutils.py:223–228  ·  view source on GitHub ↗

Return the file base name for a path. The base name is the base name of the file minus the extension. For a directory return an empty string.

(path, force_posix=False)

Source from the content-addressed store, hash-verified

221
222
223def file_base_name(path, force_posix=False):
224 """
225 Return the file base name for a path. The base name is the base name of
226 the file minus the extension. For a directory return an empty string.
227 """
228 return splitext(path, force_posix)[0]
229
230
231def file_extension(path, force_posix=False):

Callers 4

create_html_appFunction · 0.90
load_licensesFunction · 0.90
load_rulesFunction · 0.90

Calls 1

splitextFunction · 0.85

Tested by

no test coverage detected