Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- NetLib for Clipper, Version 6.0 - n_fattrget( <cfilespec>, http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
N_FATTRGET( <cFileSpec>,
            <cAttribute1>|<nAttribute1> [, @<Memvar1>
            [, <cAttribute2>|<nAttribute2>, @<Memvar2>... ] ] )
-- or --
N_FATTRGET(<cFileSpec>, <aAttribute>, <aSetting>)


Parameters

<cFileSpec>
Name of the file.

<cAttribute>
<nAttribute>
Attribute to read. May be passed as a text string or as a numeric 
value. See the table below for a list of file attributes.

@<Memvar>
Memory variable to receive the information. If you pass only one 
attribute to read, you need not pass a memory variable to receive the 
information; instead, you can get it as a return value. See the 
examples below.

<aAttribute>
An array containing the names or numbers of the attributes you wish to 
read. This is an alternative to passing a series of attribute/memory 
variable pairs.

<aSetting>
An array to receive information for the attributes listed in the 
corresponding array <aAttribute>.

The number of elements in <aSetting> must be equal to or greater than 
the number of elements in <aAttribute>, or trailing values will be 
lost. For example, if <aAttribute> has ten elements and <aSetting> has 
only seven, then attributes eight, nine, and ten will not be stored in 
the receiving array.

Clipper 5.x   If <aSetting> and <aAttribute> are initialized to 
zero elements, the function will size them correctly.


Returns

The function returns the value of the last or only attribute in the 
list, as a logical data type. If the function returns logical true, 
then the attribute is On. If it returns logical false, then the 
attribute is Off.

It is possible to call the function with only two parameters, omitting 
@<Memvar>, and obtain the information desired as a return value.


Description

Stores current settings of file attributes into memory variables. You 
can include as many attribute/memory variable pairs as needed. Reading 
several attributes in a single call is more efficient than repeated 
calls to N_FATTRGET().

Attributes may be specified by name or number. Names can be abbreviated 
to as few as three characters. Attribute numbers are defined as 
manifest constants in FATTR.CH. Using constants or their literals will 
give slightly better performance than using names.

All file attributes are of type logical. True indicates that the 
attribute is On; false, that it is Off.

Text          #define          Description
ARCHIVE       FA_ARCHIVE       Identifies files modified since last 
                               backup.

HIDDEN        FA_HIDDEN        Not displayed in a DIR listing. (Will 
                               appear in a NetWare NDIR scan if user 
                               has the File Scan right.)

READONLY      FA_READONLY      Indicates whether a file can be 
                               modified.

SYSTEM        FA_SYSTEM        System file. Hidden from DIR listing. 
                               Cannot be deleted or copied using DOS 
                               commands.

The following attributes are applicable for Novell only.

EXECUTE       FA_EXECUTE       Execute only. Assigned only to files 
                               with an .EXE or .COM extension.

SHAREABLE     FA_SHAREABLE     Several users can access simultaneously.
                               Affected by the FLAG console command.
                               Ignored by Clipper programs but may be
                               required by others.  Files to be 
                               recovered by TTS must be marked as both 
                               transactional and shareable.

TRANSACTION   FA_TRANSACTION   A file must be marked as a transactional 
                               file for it to be tracked and recovered 
                               by Novell's Transaction Tracking System 
                               (TTS).

INDEXING      FA_INDEXING      A Novell attribute used to speed up the 
                               access of very large files (10 MB and 
                               up). It has no relation to a database 
                               index file. Not used by NetWare 3.11 and 
                               higher.


Examples

LOCAL lReadonly := lTransaction := lShareable := NIL
LOCAL aAttribute[3], aSetting[3]

// Using names
N_FATTRGET('MAIN.DBF',                   ;
          'READONLY', @lReadonly,       ;
          'TRANSACTION', @lTransaction, ;
          'SHAREABLE', @lShareable)

// Using numbers
#include 'FATTR.CH'
N_FATTRGET('MAIN.DBF',                    ;
          FA_READONLY, @lReadonly,       ;
          FA_TRANSACTION, @lTransaction, ;
          FA_SHAREABLE, @lShareable)

// Multiple calls
#include 'FATTR.CH'
lReadonly = N_FATTRGET('MAIN.DBF', 'READ')
lTransaction = N_FATTRGET('MAIN.DBF', 'TRANS')
lShareable = N_FATTRGET('MAIN.DBF', 'SHARE')

// Using arrays
#include 'FATTR.CH'
aAttribute[1] = FA_READONLY
aAttribute[2] = FA_TRANSACTION
aAttribute[3] = FA_SHAREABLE
N_FATTRGET('MAIN.DBF', aAttribute, aSetting)


Files

FATTR.CH



See Also: N_FATTRSET() N_RIGHTS()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson