home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 May / Chip_2000-05_cd1.bin / zkuste / Perl / ActivePerl-5.6.0.613.msi / 䆊䌷䈹䈙䏵-䞅䞆䞀㡆䞃䄦䠥 / _711faf5fff1f25688638fd0c69be8cab < prev    next >
Text File  |  2000-03-23  |  4KB  |  107 lines

  1.  
  2. <HTML>
  3. <HEAD>
  4. <TITLE>File::stat - by-name interface to Perl's built-in stat functions</TITLE>
  5. <LINK REL="stylesheet" HREF="../../Active.css" TYPE="text/css">
  6. <LINK REV="made" HREF="mailto:">
  7. </HEAD>
  8.  
  9. <BODY>
  10. <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
  11. <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
  12. <STRONG><P CLASS=block> File::stat - by-name interface to Perl's built-in stat functions</P></STRONG>
  13. </TD></TR>
  14. </TABLE>
  15.  
  16. <A NAME="__index__"></A>
  17. <!-- INDEX BEGIN -->
  18.  
  19. <UL>
  20.  
  21.     <LI><A HREF="#name">NAME</A></LI><LI><A HREF="#supportedplatforms">SUPPORTED PLATFORMS</A></LI>
  22.  
  23.     <LI><A HREF="#synopsis">SYNOPSIS</A></LI>
  24.     <LI><A HREF="#description">DESCRIPTION</A></LI>
  25.     <LI><A HREF="#note">NOTE</A></LI>
  26.     <LI><A HREF="#author">AUTHOR</A></LI>
  27. </UL>
  28. <!-- INDEX END -->
  29.  
  30. <HR>
  31. <P>
  32. <H1><A NAME="name">NAME</A></H1>
  33. <P>File::stat - by-name interface to Perl's built-in <A HREF="../../lib/Pod/perlfunc.html#item_stat"><CODE>stat()</CODE></A> functions</P>
  34. <P>
  35. <HR>
  36. <H1><A NAME="supportedplatforms">SUPPORTED PLATFORMS</A></H1>
  37. <UL>
  38. <LI>Linux</LI>
  39. <LI>Solaris</LI>
  40. <LI>Windows</LI>
  41. </UL>
  42. <HR>
  43. <H1><A NAME="synopsis">SYNOPSIS</A></H1>
  44. <PRE>
  45.  use File::stat;
  46.  $st = stat($file) or die "No $file: $!";
  47.  if ( ($st->mode & 0111) && $st->nlink > 1) ) {
  48.      print "$file is executable with lotsa links\n";
  49.  }</PRE>
  50. <PRE>
  51.  use File::stat qw(:FIELDS);
  52.  stat($file) or die "No $file: $!";
  53.  if ( ($st_mode & 0111) && $st_nlink > 1) ) {
  54.      print "$file is executable with lotsa links\n";
  55.  }</PRE>
  56. <P>
  57. <HR>
  58. <H1><A NAME="description">DESCRIPTION</A></H1>
  59. <P>This module's default exports override the core <A HREF="../../lib/Pod/perlfunc.html#item_stat"><CODE>stat()</CODE></A> 
  60. and <A HREF="../../lib/Pod/perlfunc.html#item_lstat"><CODE>lstat()</CODE></A> functions, replacing them with versions that return 
  61. ``File::stat'' objects.  This object has methods that
  62. return the similarly named structure field name from the
  63. <A HREF="../../lib/Pod/perlfunc.html#item_stat"><CODE>stat(2)</CODE></A> function; namely,
  64. dev,
  65. ino,
  66. mode,
  67. nlink,
  68. uid,
  69. gid,
  70. rdev,
  71. size,
  72. atime,
  73. mtime,
  74. ctime,
  75. blksize,
  76. and
  77. blocks.</P>
  78. <P>You may also import all the structure fields directly into your namespace
  79. as regular variables using the :FIELDS import tag.  (Note that this still
  80. overrides your <A HREF="../../lib/Pod/perlfunc.html#item_stat"><CODE>stat()</CODE></A> and <A HREF="../../lib/Pod/perlfunc.html#item_lstat"><CODE>lstat()</CODE></A> functions.)  Access these fields as
  81. variables named with a preceding <CODE>st_</CODE> in front their method names.
  82. Thus, <CODE>$stat_obj->dev()</CODE> corresponds to $st_dev if you import
  83. the fields.</P>
  84. <P>To access this functionality without the core overrides,
  85. pass the <A HREF="../../lib/Pod/perlfunc.html#item_use"><CODE>use</CODE></A> an empty import list, and then access
  86. function functions with their full qualified names.
  87. On the other hand, the built-ins are still available
  88. via the <CODE>CORE::</CODE> pseudo-package.</P>
  89. <P>
  90. <HR>
  91. <H1><A NAME="note">NOTE</A></H1>
  92. <P>While this class is currently implemented using the Class::Struct
  93. module to build a struct-like class, you shouldn't rely upon this.</P>
  94. <P>
  95. <HR>
  96. <H1><A NAME="author">AUTHOR</A></H1>
  97. <P>Tom Christiansen</P>
  98. <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
  99. <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
  100. <STRONG><P CLASS=block> File::stat - by-name interface to Perl's built-in stat functions</P></STRONG>
  101. </TD></TR>
  102. </TABLE>
  103.  
  104. </BODY>
  105.  
  106. </HTML>
  107.