83Plus:Software:usb8x/Asm Interface/MSD/DOS updateAttributes

From WikiTI
Jump to: navigation, search

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