Index | PAL Intro | Commands | Registers | Indices | Stack | Macros | Classes | Attributes | Errors
obj/refresh - Refresh virtual attributes
Synopsis
Description
Error Handling
Examples
See Also
Author
obj/refresh ![object]
obj/refresh ![object], class <, class ... >
When supplied with one argument, refreshes all virtual attributes on the given object.
When supplied with a list of object classes, refreshes all virtual attributes associated with the given list of classes on the given object.
One or more class arguments may be provided, and are either text arguments containing the names of the object classes to refresh, or PSUNIT_TYPE_CLASSDEF registers returned by the class/load instruction.
Virtual attributes are refreshed by signaling the class hook routines that supply them with PSAPI_HK_REFRESH.
A runtime error is generated if an argument is of the wrong type, if the named class does not exist in the schema, or if a referenced object does not exist in the nexus.
The following demonstrates how to refresh the stat structure on a file object:
.main % Load file object reg/load P0, ![.prose.fs.root.tmp/test_file]
% Add stat attributes class/load P10, [psStatUnix] class/add P0, P10
% Read file permissions attr/load P11, [statMode] attr/index P1, P0, P11 reg/conv PUSH, P1, #8 attr/mvadd ![.prose.sys.io], [psStreamOut], [file mode before: ], PULL, [\n]
% Change file permissions attr/mod P0, P11, #0400
% Refresh stat data obj/refresh P0, P10
% Read file permissions again attr/index P2, P0, P11 reg/conv PUSH, P2, #8 attr/mvadd ![.prose.sys.io], [psStreamOut], [file mode after: ], PULL, [\n]
pal_commands(5), pal_registers(5), pal_indices(5), obj_def(5), obj_edit(5), class_add(5), class_load(5), ps_classes(5), ps_attributes(5),
PROSE Assembly Language at prose.sourceforge.net.
Copyright (c) 2002-2017 Mark R. Bannister <cambridge@users.sourceforge.net>.
This is free software and can be downloaded from prose.sourceforge.net; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
PAL 1.0 | obj_refresh (5) | 6 April 2017 |