=head1 NAME

POSIX::1003::FS - POSIX for the file-system

=head1 INHERITANCE

 POSIX::1003::FS
   is a POSIX::1003

=head1 SYNOPSIS

  use POSIX::1003::FS qw(access R_OK);
  if(access($fn, R_OK)) # $fn is readible?

  use POSIX::1003::FS qw(mkfifo);
  use Fcntl ':mode';
  mkfifo($path, S_IRUSR|S_IWUSR) or die $!;

  # Absorbed from Unix::Mknod
  use POSIX::1003::FS qw(mknod major minor makedev);
  use File::stat
  my $st    = stat '/dev/null';
  my $major = major $st->rdev;
  my $minor = minor $st->rdev;
  mknod '/tmp/special', S_IFCHR|0600, makedev($major,$minor+1);

=head1 DESCRIPTION

You may also need L<POSIX::1003::Pathconf|POSIX::1003::Pathconf>.

=head2 Exporter

=head1 FUNCTIONS

=head2 Standard POSIX

=over 4

=item B<access>(FILENAME, FLAGS)

Read C<man filetest> before you start using this function!
Use the C<*_OK> constants for FLAGS.

=item B<lchown>(UID, GID, FILENAMES)

Like C<chown()>, but does not follow symlinks when encountered. Returns
the number of files successfully changed.

B<Warning>, POSIX uses different parameter order:

  # POSIX specification:
  # int lchown(const char *path, uid_t owner, gid_t group);

  # Perl core implementation:
  my $successes = chown($uid, $gid, @filenames);

  use POSIX;
  POSIX::lchown($uid, $gid, $filename) or die $!;

  use POSIX::1003::FS 'lchown';
  my @successes = lchown($uid, $gid, @filenames);

=item B<mkdir>([FILENAME [MASK]])

Simple C<CORE::mkdir()>

=item B<mkfifo>(FILENAME, MODE)

=item B<mknod>(PATH, MODE, DEVICE)

Create a special device node on PATH. Useful symbols for MODE can be
collected from Fcntl (import tag C<:mode>).  The DEVICE number is
a combination from the type (I<major> number), a sequence number and
usage information (combined in a I<minor> number).

=item B<utime>(ATIME, MTIME, FILENAMES)

Simply C<CORE::utime()>

B<Warning,> C<POSIX.pm> uses a different parameter order than core.

  POSIX::utime($filename, $atime, $mtime);
  CORE::utime($atime, $mtime, @filenames);

=back

=head2 Additional

=over 4

=item B<major>(DEVICE)

=item B<makedev>(MAJOR, MINOR)

Combine MAJOR and MINOR into a single DEVICE number.

 my $device      = (stat $filename)[6];
 my $device_type = major $device;
 my $sequence_nr = minor $device;

 my $device = makedev $major, $minor;
 mknod $specialfile, $mode, $device;

=item B<minor>(DEVICE)

=back

=head1 CONSTANTS

The following constants are exported, shown here with the values
discovered during installation of this module:

=for comment
#TABLE_FSYS_START

The constant names for this math module are inserted here during
installation.

=for comment
#TABLE_FSYS_END

=head1 SEE ALSO

This module is part of POSIX-1003 distribution version 0.10,
built on January 04, 2012. Website: F<http://perl.overmeer.net>.  The code is based on L<POSIX>, which
is released with Perl itself.

=head1 COPYRIGHTS

Copyrights of the perl code and the related documentation by
2011-2012 by Mark Overmeer. For other contributors see ChangeLog.

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
See F<http://www.perl.com/perl/misc/Artistic.html>