File::Copy::Link(3pm)

πŸ“¦
version 0.200 Β· 4 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

okay bestie, this is File::Copy::Link from the Perl world β€” it's the little extension that swaps a link out for an actual copy of whatever it was pointing at. lowkey iconic, honestly. it's a (3pm) manual page, so like, it's Perl module documentation, and yes it's giving very much "I read the docs so you don't have to" energy 🫢


✨ NAME ✨

File::Copy::Link β€” the extension for replacing a link by a copy of the linked file πŸ’…


🌸 SYNOPSIS 🌸

okay so here's the whole vibe, literally just this:

use File::Copy::Link;
copylink 'file.lnk';

use File::Copy::Link qw(safecopylink);
safecopylink 'file.lnk';

that's it. that's the whole thing. no cap πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

so copylink reads the filename that's linked to by the argument (you know, whatever you handed it), and then it replaces that link with a copy of the file. the way it does it is honestly kind of unhinged but it works: it opens a filehandle to read from the link, then it deletes the link, and then it copies the filehandle back to the link. like. it opens it, kills the link, and copies the filehandle back into place. dramatic? maybe. functional? yes bestie. 😭

safecopylink does the exact same thing as copylink, but without the open-and-delete manouvre. instead, it uses File::Spec::Link to find the target of the link and copies from there. so basically it's the chill, careful version of the same idea. no link violence involved ✨

πŸ‘‘ the whole module, in one vibe

this module is mostly a wrapper round File::Spec::Link::linked and File::Copy::copy β€” like, it's those two doing the actual work, and this is the cute little wrapper holding their drinks. and guess what: the functionality is also available in a command line script copylink. so if you're more of a terminal girlie than a use girlie, you're covered πŸ’…

🌈 EXPORT

nothing by default, bestie. the module is not out here giving away exports for free. BUT it can export copylink and "safecopylink". so if you want them, you gotta ask. iykyk πŸŽ€


⭐ SEE ALSO ⭐

go read those too, they're all part of the same friend group fr fr πŸ“š


πŸŽ€ AUTHOR πŸŽ€

Robin Barker, <RMBarker@cpan.org> β€” shoutout to Robin, absolute legend, thank you for your service πŸ«‘πŸ’–


Copyright 2003, 2006, 2007, 2011, 2014, 2024 by Robin Barker

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

so like, it's free, you can share it, remix it, redistribute it, whatever β€” just keep it under the same terms as Perl itself. be cool about it 🌸

and that's a wrap, bestie!! this page is from perl v5.40.0, dated 2025-02-07, and it's the File::Copy::Link(3pm) manpage β€” now go copy some links, slay πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from