Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Full list of all win32 file attributes

by blackadder (Hermit)
on Jul 07, 2005 at 15:25 UTC ( [id://473123]=perlquestion: print w/replies, xml ) Need Help??

blackadder has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks

What with and how can I get a list of all file attributes that are available in Win32 environment using Perl?

below is an example of the types of data (i.e. attributes relating to files) that I’m interested in;
1. File Name. 2. File Type (extension). 3. Attributes (System, Hidden, Normal, Archived, compressed,.etc). 4. Creation date. 5. Last accessed date 6. Last modified date 7. Author (file owner or creator). 8. Parent directory. 9. ...etc
This is in case if there are any other useful information - that I don’t know of - about these files that I can capture and make use of. So I need to know what are all available attributes attached to a file in windows 2000 environment. And what would be the best module for me to use to extract this information?

I had a look at the modules File::Stat and Win32::File but the documentation doesn’t list all available attributes that this module can extract of any given win32 File.

Your help and a sample example code will be highly appreciated indeed.
Blackadder

Replies are listed 'Best First'.
Re: Full list of all win32 file attributes
by traveler (Parson) on Jul 07, 2005 at 16:18 UTC
    "All" is a pretty big word here. "etc" also covers a lot of ground. :-)

    Some may not consider "Parent directory" an "attribute". You can find that by looking at the full path, for example.

    That said, you probably need to do multiple modules: I doubt if any single one will do all you want. You have a good start. Also check out Win32::FileSecurity for some of the DACL information and Win32::Perms for lots of the permission information for Windows.

    HTH, --traveler

Re: Full list of all win32 file attributes
by Xaositect (Friar) on Jul 07, 2005 at 17:26 UTC

    I don't have access to a windows box at the moment, but I'd probably just try it out and see what I get. File::stat claims to just be a by-name interface to the normal stat call, so I'd see what the following gives me:

    perl -e 'use Data::Dumper; print Dumper(stat("file.txt"));'

    The Win32::File docs do mention that it exports a list of constants that look like attributes to me, (and which aren't part of the usual stat info) so again I'd probably just try it out and call Dumper on the result.


    Xaositect - Whitepages.com
Re: Full list of all win32 file attributes
by ww (Archbishop) on Jul 07, 2005 at 16:09 UTC
    suggest you start by visiting the home of such evil to see what they have to say about the members of your "...etc"

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://473123]
Approved by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2024-04-24 10:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found