Module link

Source
Expand description

This module contains the logic to link a give file from the package cache into the target directory. See link_file for more information.

Structs§

LinkedFile
The successful result of calling link_file.

Enums§

FileType
Represents the type of file detected from its content
LinkFileError
Errors that can occur when calling link_file.
LinkMethod
Describes the method to “link” a file from the source directory (or the cache directory) to the destination directory.

Functions§

copy_and_replace_cstring_placeholder
Given the contents of a file, copies it to the destination and in the process replace any binary c-style string that contains the text prefix_placeholder with a binary compatible c-string where the prefix_placeholder text is replaced with the target_prefix text.
copy_and_replace_placeholders
Given the contents of a file copy it to the destination and in the process replace the prefix_placeholder text with the target_prefix text.
copy_and_replace_textual_placeholder
Given the contents of a file copy it to the destination and in the process replace the prefix_placeholder text with the target_prefix text.
link_file
Installs a single file from a package_dir to the the target_dir. Replaces any prefix_placeholder in the file with the prefix.