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

From WikiTI
Jump to: navigation, search
 
m (Oops...link going to wrong place)
 
(2 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
'''Minimum usb8x version:''' 0.12
 
'''Minimum usb8x version:''' 0.12
  
Updates "last modified" date/time attributes and optionally others for a file or folder.
+
Updates "last modified" date/time attributes and optionally others for a file.
  
 
=== Inputs ===
 
=== Inputs ===
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
 
|}
 
|}
  
Line 46: Line 46:
 
== See Also ==
 
== See Also ==
 
* [[../DOS_fileRead|DOS_fileRead]] - Read bytes from a file at current seek pointer
 
* [[../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
+
* [[../DOS_fileWrite|DOS_fileWrite]] - Write bytes to a file at current seek pointer and grow if necessary

Latest revision as of 11:12, 20 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_fileWrite|DOS_fileWrite]] - Write bytes to a file at current seek pointer and grow if necessary