DoxigAlpha

readSmallFile

On operating systems that support symlinks, does a readlink. On other operating systems, uses the file contents. Windows supports symlinks but only with elevated privileges, so it is treated as not supporting symlinks.

Function parameters

Parameters

#
dir:fs.Dir
sub_path:[]const u8
buffer:[]u8

Type definitions in this namespace

Types

#

Functions in this namespace

Functions

#
obtain
Be sure to call `Manifest.deinit` after successful initialization.
readSmallFile
On operating systems that support symlinks, does a readlink.
writeSmallFile
On operating systems that support symlinks, does a symlink.

This is 128 bits - Even with 2^54 cache entries, the probably of a collision would be under 10^-6

Values

#
bin_digest_len
This is 128 bits - Even with 2^54 cache entries, the probably of a collision would be under 10^-6
hex_digest_len
= bin_digest_len * 2
hasher_init
Initial state with random bytes, that can be copied.

Source

Implementation

#
pub fn readSmallFile(dir: fs.Dir, sub_path: []const u8, buffer: []u8) ![]u8 {
    if (builtin.os.tag == .windows) {
        return dir.readFile(sub_path, buffer);
    } else {
        return dir.readLink(sub_path, buffer);
    }
}