Setting file attributes on Windows : File « Win32 « Perl

Home
Perl
1.Array
2.CGI
3.Class
4.Data Type
5.Database
6.File
7.GUI
8.Hash
9.Language Basics
10.Network
11.Regular Expression
12.Report
13.Statement
14.String
15.Subroutine
16.System Functions
17.Win32
18.XML
Perl » Win32 » File 




Setting file attributes on Windows
    

GetAttributes provides a scalar numeric value with special flags for the attributes. 

The basic syntax is 

use Win32::File;

Win32::File::GetAttributes($name, $attr);
The GetAttributes function returns false (0on failure and true (non-zero valueon success. 
The GetAttributes function does not set the $! variable on the error. 
The $attr variable gets filled with a number of bit flags indicating the various attributes. 

The following tabls lists the constant value defined in Win32::File 

Constant        Meaning
ARCHIVE         This flag can be used by backup programs.
COMPRESSED      File has been compressed by Windows. You cannot set this attribute.
DIRECTORY       File is a directory. You cannot set this attribute.
HIDDEN          A file that doesn't appear in listings of the directory.
NORMAL          A normal file. 
OFFLINE         Data for the file is not available due to some operating system condition.
READONLY        File is read only. 
SYSTEM          A system file. 
TEMPORARY       File was marked as a temporary file.

   
    
    
    
  














Related examples in the same category
1.To change the attributes, you can call SetAttributes.
2.File system
3.Current directory
4.File all directories
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.