MCPcopy
hub / github.com/borgbackup/borg / slashify

Function slashify

src/borg/helpers/fs.py:270–276  ·  view source on GitHub ↗

Replace backslashes with forward slashes if running on Windows. Use case: we always want to use forward slashes, even on Windows.

(path)

Source from the content-addressed store, hash-verified

268
269
270def slashify(path):
271 """
272 Replace backslashes with forward slashes if running on Windows.
273
274 Use case: we always want to use forward slashes, even on Windows.
275 """
276 return path.replace("\\", "/") if is_win32 else path
277
278
279# Bijective mapping to Unicode Private Use Area (like cifs mapchars)

Callers 4

make_path_safeFunction · 0.85
FilesystemPathSpecFunction · 0.85
_parseMethod · 0.85
create_innerMethod · 0.85

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected