Perl in a Nutshell

Perl in a NutshellSearch this book
Previous: 19.4 Win32::EventlogChapter 19
Win32 Modules and Extensions
Next: 19.6 Win32::FileSecurity
 

19.5 Win32::File

The Win32::File module allows you to view or set the attributes for files. There are two functions that allow you to do this, which must be explicitly imported to your namespace:

use Win32::File qw/GetAttributes SetAttributes/;
The constant values for the attributes are exported by default.

GetAttributes (filename, \$atts)

Returns the attribute settings for file filename and saves them as the variable referenced by $atts, which will contain an ORed combination of one or more of the following values:

ARCHIVE 
DIRECTORY 
HIDDEN 
NORMAL 
READONLY 
SYSTEM

SetAttributes (filename, atts)

Set the attributes for the file filename to the values contained in atts. The attributes are given as an ORed combination of one or more of the attribute values shown above.


Previous: 19.4 Win32::EventlogPerl in a NutshellNext: 19.6 Win32::FileSecurity
19.4 Win32::EventlogBook Index19.6 Win32::FileSecurity