Filesys::Cap - Test filesystem capabilities/characteristics
This document describes version 0.02 of Filesys::Cap (from Perl distribution Filesys-Cap), released on 2015-11-12.
use Filesys::Cap qw(fs_has_attr_x fs_is_ci fs_is_cs fs_can_symlink); say "Filesystem has x attribute" if fs_has_attr_x(); say "Filesystem is case-insensitive" if fs_is_ci("/tmp"); say "Filesystem is case-sensitive" if fs_is_cs("/tmp"); say "Filesystem can do symlinks" if fs_can_symlink("/tmp");
Return true if filesystem has x attribute, meaning it can have files that pass -x Perl file test operator as well as files that fail it. This is done by actually creating two temporary files under $dir, one chmod-ed to 0644 and one to 0755 and test the two files.
-x
$dir
If $dir is not specified, will use a temporary directory created by tempdir().
tempdir()
Will return undef on failure (e.g.: permission denied, etc).
Return true if filesystem is case-insensitive, meaning it is impossible to create two files with the same name but differing case (e.g. "foo" and "Foo"). This is done by actually creating two temporary files under $dir.
The opposite of fs_is_ci, will return true if filesystem is case-sensitive.
fs_is_ci
Return true if filesystem can do symlinks. This is tested by creating an actual temporary symlink. Note that this check is performed first:
return undef unless eval { symlink("",""); 1 };
To list filesystems and their properties (so, the more proper/rigorous version), see Sys::Filesystem.
Please visit the project's homepage at https://metacpan.org/release/Filesys-Cap.
Source repository is at https://github.com/perlancar/perl-Filesys-Cap.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Filesys-Cap
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
perlancar <perlancar@cpan.org>
This software is copyright (c) 2015 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Filesys::Cap, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Filesys::Cap
CPAN shell
perl -MCPAN -e shell install Filesys::Cap
For more information on module installation, please visit the detailed CPAN module installation guide.