File::Fu::Base(3pm)

πŸ“¦
version 0.0.8 Β· 2 versions
  • 0.0.8 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.0.8 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– File::Fu::Base πŸ’–

okay so bestie, welcome to File::Fu::Base β€” this is part of the User Contributed Perl Documentation and ngl, it's giving "secret basement level of the File::Fu mansion." No cap. Let's get into it 🫢


✨ NAME ✨

File::Fu::Base β€” nothing to see here πŸ’€

like literally, the NAME section said it itself. iconic of it honestly.


πŸŽ€ SYNOPSIS πŸŽ€

okay so here's the vibe, three lil moves:

clone πŸ¦‹

my $obj = $obj->clone;

copy that object, slay.

clonedo πŸ’…

$clone = $self->clonedo($action, @args);

clone it AND do stuff to the clone, we love a multitasker.

error 🌸

$package->error($op);

the package calls this when something's not giving.


🌈 Filetests 🌈

k so these lil one-letter baddies:

r w x o R W X O e z s f d l p S b c t u g k T B M A C

and bestie, if you need the deets: see perldoc -f -x πŸ“– (that's the perl filetest docs, go read 'em, they ate).


🧚 File::Spec stuff 🧚

lowkey this needs to be redone. not me exposing the to-do list but ok, honesty is hot.

is_absolute πŸ‘‘

(no body text, it's just out here existing. mysterious main character energy.)

relative πŸ“

get a relative name, bestie.

my $rel = $abs->relative;

also β€” and this is the good part β€” you can pass an optional relative-to directory:

my $rel = $abs->relative($to);

relative_to ✨

same as relative(), but it requires the $dir argument. no optional vibes here, it's mandatory periodt.

my $rel = $abs->relative_to($dir);

resolve πŸ”₯

fully resolve any symlinks, like untangling the group chat drama:

my $path = $path->resolve;

where $path and $linkname are both relative to the current directory:

$path->relative_symlink($linkname);

utime ⏰

update the file timestamps:

$file->utime($atime, $mtime);

optionally, set both to the same time:

$file->utime($time);

also see touch() πŸ‘€

chmod πŸ”

$path->chmod($mode);

permissions but make it cute.

rename 🏷️

calls the builtin rename() on the $path and returns a new object with that name:

$path = $path->rename($newname);

new name, new me, new object.


πŸ‘‘ Stat Object πŸ‘‘

the stat() and lstat() methods both return a File::stat object. cute.

stat πŸ“Š

my $st = $obj->stat;

lstat πŸ”

same as stat, but it does not dereference symlinks. it leaves the symlink alone, respect.

my $st = $obj->lstat;

is_same πŸͺž

returns true if the two paths are the same. and how does it know?? first by string equality, then β€” if both paths exist β€” by device+inode equality.

$bool = $path->is_same($other);

🌟 AUTHOR 🌟

Eric Wilhelm @ <ewilhelm at cpan dot org>

http://scratchcomputing.com/


😭 BUGS 😭

if you found this module on CPAN, please report any bugs or feature requests through the web interface at <http://rt.cpan.org>. bestie I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. we're in this together fr fr πŸ’–

if you pulled this development version from my /svn/, please contact me directly. slide into the DMs, metaphorically.


Copyright (C) 2008 Eric L. Wilhelm, All Rights Reserved.


πŸ’€ NO WARRANTY πŸ’€

Absolutely, positively NO WARRANTY, neither express or implied, is offered with this software. You use this software at your own risk. In case of loss, no person or entity owes you anything whatsoever. You have been warned.

like bestie. READ that again. no warranty, no take-backs, no refunds. you've been warned and I'm not playing πŸ™ˆ


🌸 LICENSE 🌸

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


okay that's the whole page bestie πŸ’… this was File::Fu::Base, from perl v5.36.0, dated 2022-12-07 β€” thanks for reading, you ate, mwah πŸ«Άβœ¨πŸŽ€

πŸ“¦ where this page comes from