forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Reading DOS compressed file attributes

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    forums.silverfrost.com Forum Index -> KBase
View previous topic :: View next topic  
Author Message
silverfrost
Site Admin


Joined: 29 Nov 2006
Posts: 137
Location: Manchester

PostPosted: Tue Sep 07, 2004 9:57 pm    Post subject: Reading DOS compressed file attributes Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    forums.silverfrost.com Forum Index -> KBase All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group