OS/2, eCS & ArcaOS - Technical > Storage
How to force a folder 'refresh' from REXX?
Dariusz Piatkowski:
I want to be able to run an on-demand (scheduled most likely) forced refresh of a particular folder, is there a call in REXX that would allow me to do so?
Basically I'm thinking the equivalent of 'RMB=>Refresh Now'.
Reason being: the built-in logic of XWP refresh causes frequent traps here (not hard trap, but soft trap) where XWP folders stop populating, this always requires either a Desktop re-start, or a complete re-boot. Since shutting this feature OFF I have been able to maintain pretty good WPS stability and rarely have the need today to force a re-boot.
However, there are certain folders, like my NAS LOG directory (where I'm sending all the various system LOGs) which of course are being populated very frequently and which my machine has a hard time detecting on a timely basis. Result being that from CLI I can see LOG udpates having been done, but through WPS these updated entries do not show up.
My thinking therefore is to schedule a forced refresh, run every 5 mins (I will play around with this) so that such particular folders are always up-to-date.
The NAS box access is through NetDrive and is a Samba share, I am currently using RL Walsh's OO.EXE to set the default folder view on several NAS folders to XVIEW, but as best as I can tell there is no option there for me to do a folder refresh.
Thanks!
Andreas Schnellbacher:
--- Code: ---/**/
CALL RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs'
CALL SysLoadFuncs
Dir = STRIP( ARG( 1))
IF LEFT( Dir, 1) = '"' THEN
PARSE VAR Dir '"'Dir'"'
CALL SysSetObjectData Dir, 'MENUITEMSELECTED=503;'
EXIT
--- End code ---
Dariusz Piatkowski:
Hi Andreas,
--- Quote from: Andreas Schnellbacher on April 11, 2020, 04:57:41 pm ---
--- Code: ---/**/
CALL RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs'
CALL SysLoadFuncs
Dir = STRIP( ARG( 1))
IF LEFT( Dir) = '"' THEN
PARSE VAR Dir '"'Dir'"'
CALL SysSetObjectData Dir, 'MENUITEMSELECTED=503;'
EXIT
--- End code ---
--- End quote ---
Thank you.
There is a small correction to the above, where you want to check for the presence of " character you need to pass number of places to the LEFT function, therefore what works here is:
--- Code: ---IF LEFT( Dir,1) = '"' THEN
--- End code ---
I assume 'MENUITEMSELECTED=503' references the 'Folder Refresh' function? If so, what's the best place for me to check to understand all these? I have the "OS/2 REXX from Bark to Byte" book here, so now that you've pointed me to the SysSetObjectData call I am able to go a bit further with this...
Remy:
Hi Dariusz,
Don't create any rexx and just use the provide tool under ArcaOS.
See here:
https://www.arcanoae.com/wiki/arcaos/post-install-tips-hints/
Under chapter :
Shadows in Tree view folders are not immediately rendered at desktop startup
(this update followed a ticket I opened in the past due to folder not correctly refreshed etc...)
Andreas Schnellbacher:
--- Quote from: Dariusz Piatkowski on April 11, 2020, 06:35:49 pm ---
--- Code: ---IF LEFT( Dir,1) = '"' THEN
--- End code ---
--- End quote ---
Sure. Changed above.
If you still need the loop or scheduling function in REXX, even though Remy has made another suggestion, ask here.
Navigation
[0] Message Index
[#] Next page
Go to full version