From: Richard D. <ric...@us...> - 2007-04-06 18:03:18
|
Update of /cvsroot/file-extattr/File-ExtAttr/lib/File In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv5336/lib/File Modified Files: ExtAttr.pm Log Message: Improve documentation for listfattr(), listfattrns() Index: ExtAttr.pm =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/lib/File/ExtAttr.pm,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** ExtAttr.pm 6 Apr 2007 11:44:00 -0000 1.19 --- ExtAttr.pm 6 Apr 2007 18:03:01 -0000 1.20 *************** *** 31,34 **** --- 31,51 ---- } + # List attributes in the default namespace. + print "Attributes of bar.txt:\n"; + foreach (listfattr($fh)) + { + print "\t$_\n"; + } + + # Examine attributes in a namespace-aware manner. + my @namespaces = listfattrns($fh); + + foreach my $ns (@namespaces) + { + print "Attributes in namespace '$ns': "; + my @attrs = listfattr($fh, { namespace => $ns }); + print join(',', @attrs)."\n"; + } + =head1 DESCRIPTION *************** *** 177,181 **** Return the value of the attribute named C<$attrname> for the file named C<$filename> or referenced by the open filehandle ! C<$filehandle> (which should be an IO::Handle). If no attribute is found, returns C<undef>. Otherwise gives a warning. --- 194,198 ---- Return the value of the attribute named C<$attrname> for the file named C<$filename> or referenced by the open filehandle ! C<$filehandle> (which should be an IO::Handle or subclass thereof). If no attribute is found, returns C<undef>. Otherwise gives a warning. *************** *** 198,202 **** Set the attribute named C<$attrname> with the value C<$attrval> for the file named C<$filename> or referenced by the open filehandle ! C<$filehandle> (which should be an IO::Handle). C<%flags> allows control of whether the attribute should be created --- 215,219 ---- Set the attribute named C<$attrname> with the value C<$attrval> for the file named C<$filename> or referenced by the open filehandle ! C<$filehandle> (which should be an IO::Handle or subclass thereof). C<%flags> allows control of whether the attribute should be created *************** *** 232,236 **** Delete the attribute named C<$attrname> for the file named C<$filename> or referenced by the open filehandle C<$filehandle> ! (which should be an IO::Handle). Returns true on success, otherwise false and a warning is issued. --- 249,253 ---- Delete the attribute named C<$attrname> for the file named C<$filename> or referenced by the open filehandle C<$filehandle> ! (which should be an IO::Handle or subclass thereof). Returns true on success, otherwise false and a warning is issued. *************** *** 251,256 **** =item listfattr([$filename | $filehandle], [\%flags]) ! Return the attributes on the file named C<$filename> or referenced by the open ! filehandle C<$filehandle> (which should be an IO::Handle). Returns undef on failure and $! will be set. --- 268,274 ---- =item listfattr([$filename | $filehandle], [\%flags]) ! Return an array of the attributes on the file named C<$filename> ! or referenced by the open filehandle C<$filehandle> (which should be ! an IO::Handle or subclass thereof). Returns undef on failure and $! will be set. *************** *** 271,277 **** =item listfattrns([$filename | $filehandle], [\%flags]) ! Return a list containing the namespaces of attributes on the file named C<$filename> or referenced by the open filehandle C<$filehandle> ! (which should be an IO::Handle). Returns undef on failure and $! will be set. --- 289,295 ---- =item listfattrns([$filename | $filehandle], [\%flags]) ! Return an array containing the namespaces of attributes on the file named C<$filename> or referenced by the open filehandle C<$filehandle> ! (which should be an IO::Handle or subclass thereof). Returns undef on failure and $! will be set. |