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

From WikiTI
Revision as of 22:12, 18 September 2006 by Brandonw (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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 or folder.

Inputs

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

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