Expand description
Choosing a downloaded file’s name and creating it without replacing anything.
Structs§
- Partial 🔒
- A file being downloaded:
name.partinfolder, which becomesname, orname (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
pathfor writing;Nonewhen 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 namemade safe to use as a file name in any folder, on every system: characters some file systems refuse becomeNAME_REPLACEMENT, so it can’t leave its folder either.