The following figure shows the syntax of SysGetEA:
Syntax: SysGetEA(file, name, variable)
where
file File containing the extended attribute.
name Name of the extended attribute, for example .ICON.
variable Name of the REXX variable containing the extended
attribute value.
The Workplace Shell uses the following extended attribute headers:
Extended Attribute
The following sample code fragments stores the file's extended attribute icon data to a temporary file. The icon data file is then modified by using the icon editor. Once saved, the icon data extended attribute is updated in the file.
/* */Arg Filename
call RxFuncAdd "SysLoadFuncs", "rexxutil", "SysLoadFuncs"
call SysLoadFuncs
TempName = 'TEMP$.ICO'
If (Stream (TempName, 'c', 'query exists') <> ' ') then
'ERASE ' TempName /* If the TempFile exists, erase it */
If SysGetEA(Filename, '.icon', 'ICON') = 0 then
do /* Load the icon extended attribute to the TempFile */
Parse Var ICON AInfo 5 ICON
do I = 1 to Length(ICON)
Rc = Charout(TmpName, Substr(Icon, I, 1))
end
If Length(Icon) \= 0 then Rc = Charout(TempName)
end
say
say 'The icon data for the file ' Filename ' will now be open '
say 'into the icon editor.'
say 'You can update the icon.'
say 'If this is a brand new icon, you will be prompted to '
say 'save the data to a file. Save it to ' TempName '.'
say 'When you are ready, press the Enter key.'
Rc=SysGetKey()
'@ICONEDIT 'TempName /* Start the icon editor */
Rc = SysSetIcon(Filename, TempName) /* Update the icon data */
/* extended attributes */
'@DEL 'TempName
return