Skip to main content

Module name

Module name 

Source
Expand description

Choosing a downloaded file’s name and creating it without replacing anything.

Structs§

Partial 🔒
A file being downloaded: name.part in folder, which becomes name, or name (1) and so on, once it is saved.

Constants§

FALLBACK_FILE_NAME 🔒
The name a file gets when its address doesn’t end in one, such as https://example.com/.
NAME_REPLACEMENT 🔒
PARTIAL_SUFFIX 🔒
Added to a file’s name while it downloads, so a file left behind, as when the app quits mid-download on macOS, reads as unfinished.
RESERVED_NAMES 🔒
Names Windows keeps for devices, with or without an extension, such as nul.txt.
UNSAFE_NAME_CHARS 🔒
Characters some file systems refuse in names, replaced by NAME_REPLACEMENT.

Functions§

create_new 🔒
Creates path for writing; None when something is there already.
file_name 🔒
The last part of the address’s path, decoded and made safe to use as a file name.
numbered 🔒
name, or for copies after the first, name (copy) before its extension.
partial_path 🔒
safe_file_name 🔒
name made safe to use as a file name in any folder, on every system: characters some file systems refuse become NAME_REPLACEMENT, so it can’t leave its folder either.