silverfrost Site Admin
Joined: 29 Nov 2006 Posts: 191 Location: Manchester
|
Posted: Tue Sep 07, 2004 9:57 pm Post subject: Reading DOS compressed file attributes |
|
|
Summary
Certain ClearWin+ functions, including FILES@, return file attribute information encoded in a single integer(kind=2).
Solution
Specific bits of this integer indicate various file attributes. These can be checked individually by using the iand intrinsic as in the following example:
Code: | if (iand(attr(1), FILE_ATTRIBUTE_DIRECTORY) > 0) print *, " directory"
if (iand(attr(1), FILE_ATTRIBUTE_HIDDEN) > 0) print *, " hidden"
if (iand(attr(1), FILE_ATTRIBUTE_NORMAL) > 0) print *, " normal"
if (iand(attr(1), FILE_ATTRIBUTE_READONLY) > 0) print *, " read only"
if (iand(attr(1), FILE_ATTRIBUTE_SYSTEM) > 0) print *, " system"
if (iand(attr(1), FILE_ATTRIBUTE_TEMPORARY) > 0) print *, " temporary" |
In this example attr is an integer(kind=2) array returned from FILES@.
You need to include 'win32prm.ins' (or use msw32prm if you prefer modules) in your program for the definitions of FILE_ATTRIBUTE_* to be present. |
|