Difference between revisions of "83Plus:Software:usb8x/Asm Interface/MSD/DOS updateAttributes"

From WikiTI
Jump to: navigation, search
m
m (Clarification)
Line 11: Line 11:
 
{| border="1" cellpadding="2"  cellspacing="0"  
 
{| border="1" cellpadding="2"  cellspacing="0"  
 
|-
 
|-
|Bit 0 || Set if bit 0 of C should be the new "archived" status
+
|Bit 0 || Set to update the "archived" status
 
|-
 
|-
|Bit 1 || Set if bit 1 of C should be the new "read-only" status
+
|Bit 1 || Set to update the "read-only" status
 
|-
 
|-
|Bit 2 || Set if bit 2 of C should be the new "hidden" status
+
|Bit 2 || Set to update the "hidden" status
 
|}
 
|}
 
* C holds the new attribute values
 
* C holds the new attribute values
 
{| border="1" cellpadding="2"  cellspacing="0"  
 
{| border="1" cellpadding="2"  cellspacing="0"  
 
|-
 
|-
|Bit 0 || Set for "archived" status
+
|Bit 0 || Set for "archived" status; ignored if bit 0 of B is reset
 
|-
 
|-
|Bit 1 || Set for "read-only" status
+
|Bit 1 || Set for "read-only" status ;ignored if bit 1 of B is reset
 
|-
 
|-
|Bit 2 || Set for "hidden" status
+
|Bit 2 || Set for "hidden" status ;ignored if bit 2 of B is reset
 
|}
 
|}
  

Revision as of 23:16, 18 September 2006

Synopsis

Name: DOS_updateAttributes

Minimum usb8x version: 0.12

Updates "last modified" date/time attributes and optionally others for a file.

Inputs

  • HL points to file handle of an opened file
  • B is flags byte
Bit 0 Set to update the "archived" status
Bit 1 Set to update the "read-only" status
Bit 2 Set to update the "hidden" status
  • C holds the new attribute values
Bit 0 Set for "archived" status; ignored if bit 0 of B is reset
Bit 1 Set for "read-only" status ;ignored if bit 1 of B is reset
Bit 2 Set for "hidden" status ;ignored if bit 2 of B is reset

Outputs

  • File attributes are changed
  • C set if problems

Destroys

  • AF, BC, DE, HL

Notes

This is somewhat like "closing" a file. It will update the "last modified" date/time attributes according to the 84+/SE clock and can also change the hidden/read-only/archived attributes. It is NOT necessary to use this function. Example code to update a file's "last modified" date/time attributes only:

ld hl,file_handle
ld b,0
U_CALL DOS_updateAttributes
...

See Also

  • [[../DOS_fileRead|DOS_fileRead]] - Read bytes from a file at current seek pointer
  • [[../DOS_fileSeek|DOS_fileWrite]] - Write bytes to a file at current seek pointer and grow if necessary