perl-docs-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject cvs commit: modperl-docs/src/docs/2.0/api/APR Const.pod Finfo.pod
Date Wed, 22 Sep 2004 01:30:06 GMT
stas        2004/09/21 18:30:06

  Modified:    src/docs/2.0/api/APR Const.pod Finfo.pod
  Log:
  - change a bunch of the APR:: constants to have a better prefix
  (APR::FILETYPE_* and APR::FILEPROT_). libapr will be changed soon too
  - Complete APR::Finfo manpage
  
  Revision  Changes    Path
  1.23      +188 -41   modperl-docs/src/docs/2.0/api/APR/Const.pod
  
  Index: Const.pod
  ===================================================================
  RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/APR/Const.pod,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -u -r1.22 -r1.23
  --- Const.pod	14 Sep 2004 19:14:10 -0000	1.22
  +++ Const.pod	22 Sep 2004 01:30:06 -0000	1.23
  @@ -1004,20 +1004,23 @@
   
   
   
  -=head2 C<:fileperms>
  +=head2 C<:fileprot>
   
  -  use APR::Const -compile => qw(:fileperms);
  +  use APR::Const -compile => qw(:fileprot);
   
  -The C<:fileperms> group is for XXX constants.
  +The C<:fileprot> group is used by
  +C<L<$finfo-E<gt>protection|docs::2.0::api::APR::Finfo/C_protection_>>.
   
   
   
   
  -=head3 C<APR::GEXECUTE>
  +=head3 C<APR_FILEPROT_GEXECUTE>
  +
  +Execute by group
   
   =over
   
  -=item since: 1.99_12
  +=item since: 1.99_17
   
   =back
   
  @@ -1025,116 +1028,186 @@
   
   
   
  -=head3 C<APR::GREAD>
  +
  +=head3 C<APR_FILEPROT_GREAD>
  +
  +Read by group
   
   =over
   
  -=item since: 1.99_12
  +=item since: 1.99_17
   
   =back
   
   
   
   
  +=head3 C<APR_FILEPROT_GSETID>
   
  -=head3 C<APR::GWRITE>
  +Set group id
   
   =over
   
  -=item since: 1.99_12
  +=item since: 1.99_17
   
   =back
   
   
   
   
  +=head3 C<APR_FILEPROT_GWRITE>
   
  -=head3 C<APR::UEXECUTE>
  +Write by group
   
   =over
   
  -=item since: 1.99_12
  +=item since: 1.99_17
   
   =back
   
   
   
   
  +=head3 C<APR_FILEPROT_OS_DEFAULT>
   
  -=head3 C<APR::UREAD>
  +use OS's default permissions
   
   =over
   
  -=item since: 1.99_12
  +=item since: 1.99_17
   
   =back
   
   
   
   
  +=head3 C<APR_FILEPROT_UEXECUTE>
   
  -=head3 C<APR::UWRITE>
  +Execute by user
   
   =over
   
  -=item since: 1.99_12
  +=item since: 1.99_17
   
   =back
   
   
   
   
  +=head3 C<APR_FILEPROT_UREAD>
   
  -=head3 C<APR::WEXECUTE>
  +Read by user
   
   =over
   
  -=item since: 1.99_12
  +=item since: 1.99_17
   
   =back
   
   
   
   
  +=head3 C<APR_FILEPROT_USETID>
   
  -=head3 C<APR::WREAD>
  +Set user id
   
   =over
   
  -=item since: 1.99_12
  +=item since: 1.99_17
   
   =back
   
   
   
   
  +=head3 C<APR_FILEPROT_UWRITE>
   
  -=head3 C<APR::WWRITE>
  +Write by user
   
   =over
   
  -=item since: 1.99_12
  +=item since: 1.99_17
  +
  +=back
  +
  +
  +
  +
  +=head3 C<APR_FILEPROT_WEXECUTE>
  +
  +Execute by others
  +
  +=over
  +
  +=item since: 1.99_17
  +
  +=back
  +
  +
  +
  +
  +=head3 C<APR_FILEPROT_WREAD>
  +
  +Read by others
  +
  +=over
  +
  +=item since: 1.99_17
   
   =back
   
   
   
   
  +=head3 C<APR_FILEPROT_WSTICKY>
  +
  +Sticky bit
  +
  +=over
  +
  +=item since: 1.99_17
  +
  +=back
  +
  +
  +
  +
  +=head3 C<APR_FILEPROT_WWRITE>
  +
  +Write by others
  +
  +=over
  +
  +=item since: 1.99_17
  +
  +=back
  +
  +
  +
  +
  +
  +
  +
  +
  +
   
   =head2 C<:filetype>
   
     use APR::Const -compile => qw(:filetype);
   
  -The C<:filetype> group is for XXX constants.
  +The C<:filetype> group is used by
  +C<L<$finfo-E<gt>filetype|docs::2.0::api::APR::Finfo/C_filetype_>>.
  +
   
   
   
  +=head3 C<APR::FILETYPE_BLK>
   
  -=head3 C<APR::NOFILE>
  +a file is a block device
   
   =over
   
  -=item since: 1.99_12
  +=item since: 1.99_17
   
   =back
   
  @@ -1142,11 +1215,14 @@
   
   
   
  -=head3 C<APR::REG>
  +
  +=head3 C<APR::FILETYPE_CHR>
  +
  +a file is a character device
   
   =over
   
  -=item since: 1.99_12
  +=item since: 1.99_17
   
   =back
   
  @@ -1154,11 +1230,13 @@
   
   
   
  -=head3 C<APR::DIR>
  +=head3 C<APR::FILETYPE_DIR>
  +
  +a file is a directory
   
   =over
   
  -=item since: 1.99_12
  +=item since: 1.99_17
   
   =back
   
  @@ -1166,11 +1244,13 @@
   
   
   
  -=head3 C<APR::CHR>
  +=head3 C<APR::FILETYPE_LNK>
  +
  +a file is a symbolic link
   
   =over
   
  -=item since: 1.99_12
  +=item since: 1.99_17
   
   =back
   
  @@ -1178,11 +1258,13 @@
   
   
   
  -=head3 C<APR::BLK>
  +=head3 C<APR::FILETYPE_NOFILE>
  +
  +the file type is undedetermined.
   
   =over
   
  -=item since: 1.99_12
  +=item since: 1.99_17
   
   =back
   
  @@ -1190,11 +1272,13 @@
   
   
   
  -=head3 C<APR::PIPE>
  +=head3 C<APR::FILETYPE_PIPE>
  +
  +a file is a FIFO or a pipe.
   
   =over
   
  -=item since: 1.99_12
  +=item since: 1.99_17
   
   =back
   
  @@ -1202,11 +1286,13 @@
   
   
   
  -=head3 C<APR::LNK>
  +=head3 C<APR::FILETYPE_REG>
  +
  +a file is a regular file.
   
   =over
   
  -=item since: 1.99_12
  +=item since: 1.99_17
   
   =back
   
  @@ -1214,11 +1300,13 @@
   
   
   
  -=head3 C<APR::SOCK>
  +=head3 C<APR::FILETYPE_SOCK>
  +
  +a file is a [unix domain] socket.
   
   =over
   
  -=item since: 1.99_12
  +=item since: 1.99_17
   
   =back
   
  @@ -1226,11 +1314,13 @@
   
   
   
  -=head3 C<APR::UNKFILE>
  +=head3 C<APR::FILETYPE_UNKFILE>
  +
  +a file is of some other unknown type or the type cannot be determined.
   
   =over
   
  -=item since: 1.99_12
  +=item since: 1.99_17
   
   =back
   
  @@ -1238,17 +1328,26 @@
   
   
   
  +
  +
  +
  +
  +
   =head2 C<:finfo>
   
     use APR::Const -compile => qw(:finfo);
   
  -The C<:finfo> group is for XXX constants.
  +The C<:finfo> group is used by
  +C<L<stat()|docs::2.0::api::APR::Finfo/C_stat_>> and
  +C<L<$finfo-E<gt>valid|docs::2.0::api::APR::Finfo/C_valid_>>.
   
   
   
   
   =head3 C<APR::FINFO_ATIME>
   
  +Access Time
  +
   =over
   
   =item since: 1.99_12
  @@ -1261,6 +1360,8 @@
   
   =head3 C<APR::FINFO_CSIZE>
   
  +Storage size consumed by the file
  +
   =over
   
   =item since: 1.99_12
  @@ -1273,6 +1374,8 @@
   
   =head3 C<APR::FINFO_CTIME>
   
  +Creation Time
  +
   =over
   
   =item since: 1.99_12
  @@ -1285,6 +1388,8 @@
   
   =head3 C<APR::FINFO_DEV>
   
  +Device
  +
   =over
   
   =item since: 1.99_12
  @@ -1297,6 +1402,8 @@
   
   =head3 C<APR::FINFO_DIRENT>
   
  +an atomic unix apr_dir_read()
  +
   =over
   
   =item since: 1.99_12
  @@ -1309,6 +1416,8 @@
   
   =head3 C<APR::FINFO_GPROT>
   
  +Group protection bits
  +
   =over
   
   =item since: 1.99_12
  @@ -1321,6 +1430,8 @@
   
   =head3 C<APR::FINFO_GROUP>
   
  +Group id
  +
   =over
   
   =item since: 1.99_12
  @@ -1333,6 +1444,8 @@
   
   =head3 C<APR::FINFO_ICASE>
   
  +whether device is case insensitive
  +
   =over
   
   =item since: 1.99_12
  @@ -1345,6 +1458,8 @@
   
   =head3 C<APR::FINFO_IDENT>
   
  +device and inode
  +
   =over
   
   =item since: 1.99_12
  @@ -1357,6 +1472,8 @@
   
   =head3 C<APR::FINFO_INODE>
   
  +Inode
  +
   =over
   
   =item since: 1.99_12
  @@ -1369,6 +1486,8 @@
   
   =head3 C<APR::FINFO_LINK>
   
  +Stat the link not the file itself if it is a link
  +
   =over
   
   =item since: 1.99_12
  @@ -1381,6 +1500,8 @@
   
   =head3 C<APR::FINFO_MIN>
   
  +type, mtime, ctime, atime, size
  +
   =over
   
   =item since: 1.99_12
  @@ -1393,6 +1514,8 @@
   
   =head3 C<APR::FINFO_MTIME>
   
  +Modification Time
  +
   =over
   
   =item since: 1.99_12
  @@ -1405,6 +1528,8 @@
   
   =head3 C<APR::FINFO_NAME>
   
  +name in proper case
  +
   =over
   
   =item since: 1.99_12
  @@ -1417,6 +1542,8 @@
   
   =head3 C<APR::FINFO_NLINK>
   
  +Number of links
  +
   =over
   
   =item since: 1.99_12
  @@ -1429,6 +1556,8 @@
   
   =head3 C<APR::FINFO_NORM>
   
  +All fields provided by an atomic unix apr_stat()
  +
   =over
   
   =item since: 1.99_12
  @@ -1441,6 +1570,8 @@
   
   =head3 C<APR::FINFO_OWNER>
   
  +user and group
  +
   =over
   
   =item since: 1.99_12
  @@ -1453,6 +1584,8 @@
   
   =head3 C<APR::FINFO_PROT>
   
  +all protections
  +
   =over
   
   =item since: 1.99_12
  @@ -1465,6 +1598,8 @@
   
   =head3 C<APR::FINFO_SIZE>
   
  +Size of the file
  +
   =over
   
   =item since: 1.99_12
  @@ -1477,6 +1612,8 @@
   
   =head3 C<APR::FINFO_TYPE>
   
  +Type
  +
   =over
   
   =item since: 1.99_12
  @@ -1489,6 +1626,8 @@
   
   =head3 C<APR::FINFO_UPROT>
   
  +User protection bits
  +
   =over
   
   =item since: 1.99_12
  @@ -1501,6 +1640,8 @@
   
   =head3 C<APR::FINFO_USER>
   
  +User id
  +
   =over
   
   =item since: 1.99_12
  @@ -1513,11 +1654,17 @@
   
   =head3 C<APR::FINFO_WPROT>
   
  +World protection bits
  +
   =over
   
   =item since: 1.99_12
   
   =back
  +
  +
  +
  +
   
   
   
  
  
  
  1.7       +250 -163  modperl-docs/src/docs/2.0/api/APR/Finfo.pod
  
  Index: Finfo.pod
  ===================================================================
  RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/APR/Finfo.pod,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -u -r1.6 -r1.7
  --- Finfo.pod	28 May 2004 02:55:15 -0000	1.6
  +++ Finfo.pod	22 Sep 2004 01:30:06 -0000	1.7
  @@ -2,15 +2,35 @@
   
   APR::Finfo - Perl API for APR fileinfo structure
   
  -XXX: Besides working through the doc we need to get good constant
  -names from libapr (needs apr patching)
  -
   
   =head1 Synopsis
   
     use APR::Finfo ();
  +  use APR::Const -compile => qw(FINFO_NORM);
  +  my $finfo = APR::Finfo::stat("/tmp/test", APR::FINFO_NORM, $pool);
  +  
  +  $device = $finfo->device;     # (stat $file)[0]
  +  $inode  = $finfo->inode;      # (stat $file)[1]
  +  $prot   = $finfo->protection; # (stat $file)[2]
  +  $nlink  = $finfo->nlink;      # (stat $file)[3]
  +  $gid    = $finfo->group;      # (stat $file)[4]
  +  $uid    = $finfo->user;       # (stat $file)[5]
  +  $size   = $finfo->size;       # (stat $file)[7]
  +  $atime  = $finfo->atime;      # (stat $file)[8]
  +  $mtime  = $finfo->mtime;      # (stat $file)[9]
  +  $ctime  = $finfo->ctime;      # (stat $file)[10]
  +  
  +  $csize = $finfo->csize; # consumed size: not portable!
  +  
  +  $filetype = $finfo->filetype; # file/dir/socket/etc
  +  
  +  $fname = $finfo->fname;
  +  $name  = $finfo->name;  # in filesystem case:
  +  
  +  # valid fields that can be queried
  +  $valid = $finfo->valid;
  +
   
  -META: to be completed
   
   
   
  @@ -40,153 +60,183 @@
   
   
   
  -=head2 C<stat>
  +=head2 C<atime>
   
  -Get the specified file's stats.  The file is specified by filename,
  -instead of using a pre-opened file.
  +Get the time the file was last accessed:
   
  -  $finfo = stat($fname, $wanted_fields, $pool);
  +  $atime = $finfo->atime;
   
   =over 4
   
  -=item arg1: C<$fname> ( string )
  -
  -The path to the file to C<stat()>.
  -
  -=item arg2: C<$wanted> ( string )
  +=item obj: C<$finfo>
  +( C<L<APR::Finfo object|docs::2.0::api::APR::Finfo>> )
   
  -The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values
  +=item return: C<$atime> ( integer )
   
  -XXX
  +Last access time in seconds since the epoch
   
  -=item arg3: C<$pool> ( integer )
  +=item since: 1.99_12
   
  -the pool to use to allocate the new file.
  +=back
   
  -=item ret: C<$finfo>
  -( C<L<APR::Finfo|docs::2.0::api::APR::Finfo>> )
  +This method returns the same value as Perl's:
   
  -=item since: 1.99_12
  +  (stat $filename)[8]
   
  -=back
  +Note that this method may not be reliable on all platforms, most
  +notably Win32 -- FAT32 filesystems appear to work properly, but NTFS
  +filesystems do not.
   
   
   
   
   
  -=head2 C<pool>
   
  -META: Autogenerated - needs to be reviewed/completed
  +=head2 C<csize>
   
  -Allocates memory and closes lingering handles in the specified pool
  +Get the storage size consumed by the file
   
  -  $ret = $obj->pool($newval);
  +  $csize = $finfo->csize;
   
   =over 4
   
  -=item obj: C<$obj>
  -( C<L<APR::Finfo|docs::2.0::api::APR::Finfo>> )
  +=item obj: C<$finfo>
  +( C<L<APR::Finfo object|docs::2.0::api::APR::Finfo>> )
   
  -=item arg1: C<$newval>
  -( C<L<APR::Pool|docs::2.0::api::APR::Pool>> )
  +=item return: C<$csize> ( integer )
   
   =item since: 1.99_12
   
   =back
   
  +Chances are that you don't want to use this method, since its
  +functionality is not supported on most platforms (in which case it
  +always returns 0).
   
   
   
   
  -=head2 C<valid>
   
  -META: Autogenerated - needs to be reviewed/completed
   
  -The bitmask describing valid fields of this apr_finfo_t structure
  -including all available 'wanted' fields and potentially more
   
  -  $ret = $obj->valid($newval);
  +=head2 C<ctime>
  +
  +Get the time the file was last changed
  +
  +  $ctime = $finfo->ctime;
   
   =over 4
   
  -=item obj: C<$obj>
  -( C<L<APR::Finfo|docs::2.0::api::APR::Finfo>> )
  +=item obj: C<$finfo>
  +( C<L<APR::Finfo object|docs::2.0::api::APR::Finfo>> )
  +
  +=item return: C<$ctime> ( integer )
   
  -=item arg1: C<$newval> ( integer )
  +Inode change time in seconds since the epoch
   
   =item since: 1.99_12
   
   =back
   
  +This method returns the same value as Perl's:
   
  +  (stat $filename)[10]
  +
  +The ctime field is non-portable.  In particular, you cannot expect it
  +to be a "creation time", see "Files and Filesystems" in the
  +I<perlport> manpage for details.
   
   
   
  -=head2 C<protection>
   
  -META: Autogenerated - needs to be reviewed/completed
   
  -The access permissions of the file.  Mimics Unix access rights.
   
  -  $ret = $obj->protection($newval);
  +=head2 C<device>
  +
  +Get the id of the device the file is on.
  +
  +  $device = $finfo->device;
   
   =over 4
   
  -=item obj: C<$obj>
  -( C<L<APR::Finfo|docs::2.0::api::APR::Finfo>> )
  +=item obj: C<$finfo>
  +( C<L<APR::Finfo object|docs::2.0::api::APR::Finfo>> )
   
  -=item arg1: C<$newval> ( integer )
  +=item return: C<$device> ( integer )
   
   =item since: 1.99_12
   
   =back
   
  +This method returns the same value as Perl's:
   
  +  (stat $filename)[0]
   
  +Note that this method is non-portable. It doesn't work on all
  +platforms, most notably Win32.
   
   
  -=head2 C<filetype>
   
  -META: Autogenerated - needs to be reviewed/completed
   
  -The type of file.  One of APR_REG, APR_DIR, APR_CHR, APR_BLK, APR_PIPE,
  -APR_LNK or APR_SOCK.  If the type is undetermined, the value is APR_NOFILE.
  -If the type cannot be determined, the value is APR_UNKFILE.
   
  -  $ret = $obj->filetype($newval);
  +
  +=head2 C<filetype>
  +
  +Get the type of file.
  +
  +  $filetype = $finfo->filetype;
   
   =over 4
   
  -=item obj: C<$obj>
  -( C<L<APR::Finfo|docs::2.0::api::APR::Finfo>> )
  +=item obj: C<$finfo>
  +( C<L<APR::Finfo object|docs::2.0::api::APR::Finfo>> )
   
  -=item arg1: C<$newval> ( integer )
  +=item return: C<$filetype> ( C<L<:filetype
  +constant|docs::2.0::api::APR::Const/C__filetype_>> )
   
  -=item since: 1.99_12
  +=item since: 1.99_17
   
   =back
   
  +For example:
   
  +  use APR::Pool;
  +  use APR::Finfo;
  +  use APR::Const -compile => qw(FILETYPE_DIR FILETYPE_REG FINFO_NORM);
  +  my $pool  = APR::Pool->new();
  +  my $finfo = APR::Finfo::stat("/tmp", APR::FINFO_NORM, $pool);
  +  my $finfo = $finfo->filetype;
  +  if ($finfo == APR::FILETYPE_REG) {
  +      print "regular file";
  +  }
  +  elsif ($finfo == APR::FILETYPE_REG) {
  +      print "directory";
  +  }
  +  else {
  +      print "other file";
  +  }
   
  +Since F</tmp> is a directory, this will print:
   
  +  directory
   
  -=head2 C<user>
   
  -META: Autogenerated - needs to be reviewed/completed
   
  -The user id that owns the file
   
  -  $ret = $obj->user($newval);
   
  -Note that this method may not be meaningful on all platforms,
  -most notably Win32.
  +
  +=head2 C<fname>
  +
  +Get the pathname of the file (possibly unrooted)
  +
  +  $fname = $finfo->fname;
   
   =over 4
   
  -=item obj: C<$obj>
  -( C<L<APR::Finfo|docs::2.0::api::APR::Finfo>> )
  +=item obj: C<$finfo>
  +( C<L<APR::Finfo object|docs::2.0::api::APR::Finfo>> )
   
  -=item arg1: C<$newval> ( integer )
  +=item return: C<$filetype> ( string )
   
   =item since: 1.99_12
   
  @@ -196,100 +246,110 @@
   
   
   
  -=head2 C<group>
   
  -META: Autogenerated - needs to be reviewed/completed
   
  -The group id that owns the file
   
  -  $ret = $obj->group($newval);
  +=head2 C<group>
   
  -Note that this method may not be meaningful on all platforms,
  -most notably Win32.  Incorrect results have also been reported
  -on some versions of OSX.
  +Get the group id that owns the file:
  +
  +  $gid = $finfo->group;
   
   =over 4
   
  -=item obj: C<$obj>
  -( C<L<APR::Finfo|docs::2.0::api::APR::Finfo>> )
  +=item obj: C<$finfo>
  +( C<L<APR::Finfo object|docs::2.0::api::APR::Finfo>> )
   
  -=item arg1: C<$newval> ( integer )
  +=item return: C<$gid> ( number )
   
   =item since: 1.99_12
   
   =back
   
  +This method returns the same value as Perl's:
   
  +  (stat $filename)[5]
   
  +Note that this method may not be meaningful on all platforms, most
  +notably Win32.  Incorrect results have also been reported on some
  +versions of OSX.
   
   
  -=head2 C<inode>
   
  -META: Autogenerated - needs to be reviewed/completed
   
  -The inode of the file.
   
  -  $ret = $obj->inode($newval);
   
  -Note that this method may not be meaningful on all platforms,
  -most notably Win32.
  +
  +=head2 C<inode>
  +
  +Get the inode of the file.
  +
  +  $inode = $finfo->inode;
   
   =over 4
   
  -=item obj: C<$obj>
  -( C<L<APR::Finfo|docs::2.0::api::APR::Finfo>> )
  +=item obj: C<$finfo>
  +( C<L<APR::Finfo object|docs::2.0::api::APR::Finfo>> )
   
  -=item arg1: C<$newval> ( integer )
  +=item return: C<$inode> ( integer )
   
   =item since: 1.99_12
   
   =back
   
  +This method returns the same value as Perl's:
   
  +  (stat $filename)[1]
   
  +Note that this method may not be meaningful on all platforms, most
  +notably Win32.
   
   
  -=head2 C<device>
   
  -META: Autogenerated - needs to be reviewed/completed
   
  -The id of the device the file is on.
   
  -  $ret = $obj->device($newval);
   
  -Note that this method may not be meaningful on all platforms,
  -most notably Win32.
  +
  +=head2 C<mtime>
  +
  +The time the file was last modified
  +
  +  $mtime = $finfo->mtime;
   
   =over 4
   
  -=item obj: C<$obj>
  -( C<L<APR::Finfo|docs::2.0::api::APR::Finfo>> )
  +=item obj: C<$finfo>
  +( C<L<APR::Finfo object|docs::2.0::api::APR::Finfo>> )
  +
  +=item return: C<$mtime> ( integer )
   
  -=item arg1: C<$newval>
  -(number)
  +Last modify time in seconds since the epoch
   
   =item since: 1.99_12
   
   =back
   
  +This method returns the same value as Perl's:
  +
  +  (stat $filename)[9]
  +
   
   
   
   
  -=head2 C<nlink>
   
  -META: Autogenerated - needs to be reviewed/completed
  +=head2 C<name>
   
  -The number of hard links to the file.
  +Get the file's name (no path) in filesystem case:
   
  -  $ret = $obj->nlink($newval);
  +  $name = $finfo->name;
   
   =over 4
   
  -=item obj: C<$obj>
  -( C<L<APR::Finfo|docs::2.0::api::APR::Finfo>> )
  +=item obj: C<$finfo>
  +( C<L<APR::Finfo object|docs::2.0::api::APR::Finfo>> )
   
  -=item arg1: C<$newval> ( integer )
  +=item return: C<$device> ( string )
   
   =item since: 1.99_12
   
  @@ -299,171 +359,198 @@
   
   
   
  -=head2 C<size>
   
  -META: Autogenerated - needs to be reviewed/completed
  +=head2 C<nlink>
   
  -The size of the file
  +Get the number of hard links to the file.
   
  -  $ret = $obj->size($newval);
  +  $nlink = $finfo->nlink;
   
   =over 4
   
  -=item obj: C<$obj>
  -( C<L<APR::Finfo|docs::2.0::api::APR::Finfo>> )
  +=item obj: C<$finfo>
  +( C<L<APR::Finfo object|docs::2.0::api::APR::Finfo>> )
   
  -=item arg1: C<$newval> ( integer )
  +=item return: C<$nlink> ( integer )
   
   =item since: 1.99_12
   
   =back
   
  +This method returns the same value as Perl's:
   
  +  (stat $filename)[3]
   
   
   
  -=head2 C<csize>
   
  -META: Autogenerated - needs to be reviewed/completed
   
  -The storage size consumed by the file
   
  -  $ret = $obj->csize($newval);
  +
  +
  +
  +=head2 C<protection>
  +
  +Get the access permissions of the file.  Mimics Unix access rights.
  +
  +  $prot = $finfo->protection;
   
   =over 4
   
  -=item obj: C<$obj>
  -( C<L<APR::Finfo|docs::2.0::api::APR::Finfo>> )
  +=item obj: C<$finfo>
  +( C<L<APR::Finfo object|docs::2.0::api::APR::Finfo>> )
   
  -=item arg1: C<$newval> ( integer )
  +=item return: C<$prot> ( C<L<:fileprot
  +constant|docs::2.0::api::APR::Const/C__fileprot_>> )
   
  -=item since: 1.99_12
  +=item since: 1.99_17
   
   =back
   
  +This method returns the same value as Perl's:
  +
  +  (stat $filename)[2]
   
   
   
   
  -=head2 C<atime>
   
  -META: Autogenerated - needs to be reviewed/completed
   
  -The time the file was last accessed
   
  -  $ret = $obj->atime($newval);
   
  -Note that this method may not be reliable on all platforms,
  -most notably Win32 - FAT32 filesystems appear to work properly
  -but NTFS filesystems do not.
  +=head2 C<size>
  +
  +Get the size of the file
  +
  +  $size = $finfo->size;
   
   =over 4
   
  -=item obj: C<$obj>
  -( C<L<APR::Finfo|docs::2.0::api::APR::Finfo>> )
  +=item obj: C<$finfo>
  +( C<L<APR::Finfo object|docs::2.0::api::APR::Finfo>> )
  +
  +=item return: C<$size> ( integer )
   
  -=item arg1: C<$newval>
  -(number)
  +Total size of file, in bytes
   
   =item since: 1.99_12
   
   =back
   
  +This method returns the same value as Perl's:
   
  +  (stat $filename)[7]
   
   
   
  -=head2 C<mtime>
   
  -META: Autogenerated - needs to be reviewed/completed
   
  -The time the file was last modified
   
  -  $ret = $obj->mtime($newval);
   
  -=over 4
  +=head2 C<stat>
   
  -=item obj: C<$obj>
  -( C<L<APR::Finfo|docs::2.0::api::APR::Finfo>> )
  +Get the specified file's stats.
   
  -=item arg1: C<$newval>
  -(number)
  +  $finfo = APR::Finfo::stat($fname, $wanted_fields, $p);
   
  -=item since: 1.99_12
  +=over 4
   
  -=back
  +=item arg1: C<$fname> ( string )
   
  +The path to the file to C<stat()>.
   
  +=item arg2: C<$wanted_fields> ( C<L<:finfo
  +constant|docs::2.0::api::APR::Const/C__finfo_>> )
   
  +The desired fields, as a bitmask flag of
  +C<L<APR::FINFO_*|docs::2.0::api::APR::Const/C__finfo_>> constants.
   
  +Notice that you can also use the constants that already combine
  +several elements in one. For example
  +C<L<APR::FINFO_PROT|docs::2.0::api::APR::Const/C_APR__FINFO_PROT_>>
  +asks for all protection bits,
  +C<L<APR::FINFO_MIN|docs::2.0::api::APR::Const/C_APR__FINFO_MIN_>> asks
  +for the following fields: type, mtime, ctime, atime, size and
  +C<L<APR::FINFO_NORM|docs::2.0::api::APR::Const/C_APR__FINFO_NORM_>>
  +asks for all atomic unix C<apr_stat()> fields (similar to perl's
  +C<stat()>).
   
  -=head2 C<ctime>
  +=item arg3: C<$p> ( C<L<APR::Pool object|docs::2.0::api::APR::Pool>>
)
   
  -META: Autogenerated - needs to be reviewed/completed
  +the pool to use to allocate the file stat structure.
   
  -The time the file was last changed
  +=item ret: C<$finfo>
  +( C<L<APR::Finfo object|docs::2.0::api::APR::Finfo>> )
   
  -  $ret = $obj->ctime($newval);
  +=item since: 1.99_12
   
  -=over 4
  +=back
   
  -=item obj: C<$obj>
  -( C<L<APR::Finfo|docs::2.0::api::APR::Finfo>> )
  +For example, here is how to get most of the C<stat> fields:
   
  -=item arg1: C<$newval>
  -(number)
  +  use APR::Pool ();
  +  use APR::Finfo ();
  +  use APR::Const -compile => qw(FINFO_NORM);
  +  my $pool = APR::Pool->new();
  +  my $finfo = APR::Finfo::stat("/tmp/test", APR::FINFO_NORM, $pool);
   
  -=item since: 1.99_12
   
  -=back
   
   
   
   
   
  -=head2 C<fname>
   
  -META: Autogenerated - needs to be reviewed/completed
  +=head2 C<user>
   
  -The pathname of the file (possibly unrooted)
  +Get the user id that owns the file:
   
  -  $ret = $obj->fname($newval);
  +  $uid = $finfo->user;
   
   =over 4
   
  -=item obj: C<$obj>
  -( C<L<APR::Finfo|docs::2.0::api::APR::Finfo>> )
  +=item obj: C<$finfo>
  +( C<L<APR::Finfo object|docs::2.0::api::APR::Finfo>> )
   
  -=item arg1: C<$newval>
  -( string )
  +=item return: C<$uid> ( number )
   
   =item since: 1.99_12
   
   =back
   
  +This method returns the same value as Perl's:
   
  +  (stat $filename)[4]
  +
  +Note that this method may not be meaningful on all platforms,
  +most notably Win32.
   
   
   
  -=head2 C<name>
   
  -META: Autogenerated - needs to be reviewed/completed
   
  -The file's name (no path) in filesystem case
   
  -  $ret = $obj->name($newval);
  +=head2 C<valid>
  +
  +The bitmask describing valid fields of this apr_finfo_t structure
  +including all available 'wanted' fields and potentially more
  +
  +  $valid = $finfo->valid;
   
   =over 4
   
  -=item obj: C<$obj>
  -( C<L<APR::Finfo|docs::2.0::api::APR::Finfo>> )
  +=item obj: C<$finfo>
  +( C<L<APR::Finfo object|docs::2.0::api::APR::Finfo>> )
  +
  +=item arg1: C<$valid> ( bitmask )
   
  -=item arg1: C<$newval>
  -( string )
  +This bitmask flag should be bit-OR'ed against C<L<:finfo
  +constant|docs::2.0::api::APR::Const/C__finfo_>> constants.
   
   =item since: 1.99_12
   
   =back
  +
   
   
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: docs-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-cvs-help@perl.apache.org


Mime
View raw message