NAME

Prima::sys::FS - unicode-aware core file functions

DESCRIPTION

Since perl win32 unicode support for files is unexistent, Prima has its own parallel set of functions mimicking native functions, ie open, chdir etc. This means that 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.

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

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:

These are 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 underscore-prefixed functions are same as the ones in "-X" in perlfunc (all are present except -T and -B ).

_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 functions that are implemented in the module itself:

abs_path

Same as Cwd::abs_path.

copy SRC, DST

Copies a file, returns undef as a success or an error string otherwise

glob PATTERN

More or less same as CORE::glob or File::Glob::glob.

lstat PATH

Same as CORE::lstat

traverse &CALLBACK(%CONTENT), DIRECTORY, [ %OPTIONS ]

Traverses DIRECTORY, calls &CALLBACK for each entry where %CONTENT has the following entries: directory, name, fullname, path, abs_path, stop. The stop is a function to be called to stop the traversal.

%OPTIONS: follow = 1, chdir = 1, warn = 1.

Return 1 for success, 0 if was stopped, -1 for failure.

AUTHOR

Dmitry Karasik, <dmitry@karasik.eu.org>.

SEE ALSO

Prima::Utils, Win32::Unicode.