Prima::sys::FS(3)

πŸ“¦
version 1.74000 Β· 5 versions
, in opensuse-leap 16.0

πŸ’… Prima::sys::FS(3) β€” unicode-aware core file functions πŸ’…

This is the Prima::sys::FS(3) page from the User Contributed Perl Documentation, and it's literally about making file stuff behave with Unicode. Buckle up, bestie. πŸ¦‹


🌸 NAME 🌸

Prima::sys::FS β€” unicode-aware core file functions. That's the name, that's the vibe, no cap. πŸ’–


✨ DESCRIPTION ✨

Okay so here's the situation: on perl win32, unicode support for files is unexistent. Not a vibe. So Prima has its own parallel set of functions mimicking the native functions, ie open, chdir etc. The whole point? Files with names that cannot be converted to ANSI (ie user-preferred) codepage are not visible in perl, but the functions below mitigate this problem. Slay. πŸ’…

The module exports the unicode-aware functions from Prima::Utils to override the core functions. Read more in "Unicode-aware file system functions" in Prima::Utils.


πŸ¦‹ SYNOPSIS πŸ¦‹

Here's the demo, bestie β€” keep it exactly as written:

use Prima::sys::FS;

my $fn = "\x{dead}\x{beef};
if ( _f $fn ) {
   open F, ">", $fn or die $!;
   close F;
}
print "ls: ", getdir, "\n";
print "pwd: ", getcwd, "\n";

πŸ’– API πŸ’–

The module exports by default three groups of functions. Periodt. Here's the whole roster:

The first group is described in "API" in Prima::Utils:

chdir chmod getcwd link mkdir open rename rmdir unlink utime
getenv setenv stat access getdir
opendir closedir rewinddir seekdir readdir telldir

The second group is the underscore-prefixed squad β€” same as the ones in -X in perlfunc. All are present except -T and -B. Here's the lineup:

_r _w _x _o _R _W _X _O _e _z _s _f _d _l _p _S _b _c _t _u _g _k _M _A _C

The third group is implemented in the module itself β€” these cuties right here:

  • abs_path β€” same as "Cwd::abs_path".
  • glob PATTERN β€” more or less same as "CORE::glob" or "File::Glob::glob".
  • lstat PATH β€” same as "CORE::lstat".

πŸ‘‘ AUTHOR πŸ‘‘

Dmitry Karasik, <dmitry@karasik.eu.org>. Legend behavior. 🫢


πŸŽ€ SEE ALSO πŸŽ€

  • Prima::Utils
  • Win32::Unicode

Bye bestie! This page is Prima::sys::FS(3) from perl v5.42.0, dated 2024-08-20. Stay unicode-y. πŸ’œβœ¨

πŸ“¦ where this page comes from