User`s guide
BDOS FUNCTION 30: SET FILE ATTRIBUTES
Entry Parameters:
Registers C: 1EH
DE: FCB Address
Returned Value:
Registers A: Directory Code
H: Physical or Extended error
By calling the Set File Attributes function, a program can modify a file's attributes
and set its last record byte count. Other BDOS functions can be called to interrogate
these file parameters, but only Function 30 can change them. The file attributes that
can be set or reset by Function 30 are fl' through f4', Read-Only, tl', System, t2',
and Archive, t3'. The register pair DE addresses an FCB containing a filename with
the appropriate attributes set or reset. The calling program must ensure that it does
not specify an ambiguous filename. In addition, if the specified file is password to-
tected, the correct password must be placed in the first eight bytes of the current
DMA buffer or have been previously established as the default password (see Func-
tion 106).
Interface attribute f6' specifies whether the last record byte count of the specified
file is to be set:
f6' = 0 - Do not set byte count (default mode)
f6' = 1 - Set byte count
If interface attribute f6' is set, the calling program must set the cr field of the refer-
enced FCB to the byte count value. A program can access a file's byte count value
with the BDOS Open, Search, or Search Next functions.
Function 30 searches the referenced directory for entries belonging to the current
user number that matches the FCB specified name and type fields. The function then
updates the directory to contain the selected indicators, and if interface attribute f6'
is set, the specified byte count value. Note that the last record byte count is main-
tained in byte 13 of a file's directory FCBS.
3-44
BDOS Function Calls CP/M 3 Programmers Guide