Function writeSmallFile [src]

On operating systems that support symlinks, does a symlink. On other operating systems, uses the file contents. Windows supports symlinks but only with elevated privileges, so it is treated as not supporting symlinks. data must be a valid UTF-8 encoded file path and 255 bytes or fewer.

Prototype

pub fn writeSmallFile(dir: fs.Dir, sub_path: []const u8, data: []const u8) !void

Parameters

dir: fs.Dirsub_path: []const u8data: []const u8

Source

pub fn writeSmallFile(dir: fs.Dir, sub_path: []const u8, data: []const u8) !void { assert(data.len <= 255); if (builtin.os.tag == .windows) { return dir.writeFile(.{ .sub_path = sub_path, .data = data }); } else { return dir.symLink(data, sub_path, .{}); } }