symlink(3pm)

πŸ“¦
version 0.05 Β· 5 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

okay bestie, gather round, because this is one of those tiny little Perl modules that does one (1) thing and does it iconically. It's PerlIO::via::symlink, a piece of the User Contributed Perl Documentation, and it's basically the group chat between you and your filehandles: you write, it symlinks. slay.


✨ NAME ✨

PerlIO::via::symlink β€” PerlIO layers for create symlinks πŸ¦‹

(not me leaving the original grammar exactly as it found it, we respect the source in this house)


✨ SYNOPSIS ✨

here's the whole vibe, three lines, no notes:

open $fh, '>:via(symlink)', $fname;
print $fh "link foobar";
close $fh;

that's it. that's the whole main character moment. πŸ’…


🌸 DESCRIPTION 🌸

so the PerlIO layer symlink lets you create a symbolic link just by writing to the file handle. yes fr fr, you don't call symlink() yourself, you just write and the layer handles it. lowkey genius.

here's the tea though β€” you need to write "link $name" to the file handle. that exact format. that's the whole contract.

🚨 and if the format does not match? bestie, close will fail with EINVAL. it's giving "we had one job and the format was it." so write it right. πŸ’€

🧚 TEST COVERAGE 🧚

the receipts, unedited, because this module is fully covered and wants you to know:

----------------------------------- ------ ------ ------ ------ ------ ------
File                                  stmt branch   cond    sub   time  total
----------------------------------- ------ ------ ------ ------ ------ ------
blib/lib/PerlIO/via/symlink.pm       100.0  100.0    n/a  100.0  100.0  100.0
Total                                100.0  100.0    n/a  100.0  100.0  100.0
----------------------------------- ------ ------ ------ ------ ------ ------

100.0 across the board, periodt. the cond column is n/a, don't come for her. πŸ‘‘


🫢 AUTHORS 🫢

Chia-liang Kao <clkao@clkao.org>


Copyright 2004-2005 by Chia-liang Kao <clkao@clkao.org>.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See <http://www.perl.com/perl/misc/Artistic.html>


okay and that's the whole page!! πŸ’– this was symlink(3pm), straight out of perl v5.36.0, dated 2022-11-19 β€” tysm for reading bestie, go make some symlinks, and remember: format the write correctly or close will simply not. mwah πŸŽ€βœ¨

πŸ“¦ where this page comes from