home *** CD-ROM | disk | FTP | other *** search
/ isnet Internet / Isnet Internet CD.iso / prog / hiz / 09 / 09.exe / adynware.exe / perl / lib / site / Win32 / File.pm < prev    next >
Encoding:
Perl POD Document  |  1999-12-28  |  1.2 KB  |  81 lines

  1. package Win32::File;
  2.  
  3.  
  4. $VERSION = '0.03';
  5.  
  6. require Exporter;
  7. require DynaLoader;
  8.  
  9. @ISA= qw( Exporter DynaLoader );
  10. @EXPORT = qw(
  11.         ARCHIVE
  12.         COMPRESSED
  13.         DIRECTORY
  14.         HIDDEN
  15.         NORMAL
  16.         READONLY
  17.         SYSTEM
  18.     );
  19.  
  20. =head1 NAME
  21.  
  22. Win32::File - manage file attributes in perl
  23.  
  24. =head1 SYNOPSIS
  25.  
  26.     use Win32::File;
  27.  
  28. =head1 DESCRIPTION
  29.  
  30. This module offers the retrieval and setting of file attributes.
  31.  
  32. =head1 FUNCTIONS
  33.  
  34. =head2 NOTE:
  35. all of the functions return FALSE (0) if they fail, unless otherwise noted.
  36.  
  37. =over 10
  38.  
  39. =item GetAttributes(filename, returnedAttirbutes)
  40.     Gets the attributes of a file or directory
  41.  
  42. =item SetAttributes(filename, newAttirbutes)
  43.     Sets the attributes of a file or directory
  44.  
  45. =back
  46.  
  47. =cut
  48.  
  49. sub AUTOLOAD 
  50. {
  51.  
  52.     my($constname);
  53.     ($constname = $AUTOLOAD) =~ s/.*:://;
  54.     $!=0;
  55.     my $val = constant($constname);
  56.     if($! != 0)
  57.     {
  58.         if($! =~ /Invalid/)
  59.         {
  60.             $AutoLoader::AUTOLOAD = $AUTOLOAD;
  61.             goto &AutoLoader::AUTOLOAD;
  62.         }
  63.         else 
  64.         {
  65.             ($pack,$file,$line) = caller;
  66.             die "Your vendor has not defined Win32::File macro $constname, used in $file at line $line.";
  67.         }
  68.     }
  69.     eval "sub $AUTOLOAD { $val }";
  70.     goto &$AUTOLOAD;
  71. }
  72.  
  73. bootstrap Win32::File;
  74.  
  75. 1;
  76. __END__
  77.  
  78.  
  79.  
  80.  
  81.