Author Topic: Links?  (Read 1065 times)

Ben

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 3
  • Posts: 182
  • Know Thyself
    • View Profile
Links?
« on: May 02, 2018, 04:06:09 pm »
I am surprised that there is not a forum here dedicated to WPS/Desktop/PM issues, as such, I'll post this topic here. Maybe Martin might consider adding one, (did I overlook it?).

Of course, I know all about object shadows et all, but is there an OS/2 equivalent to *nix links? Shadows can come and go and might not necessarily survive a desktop restore. I would like something more permanent.

Any ideas?

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 9
  • -Receive: 110
  • Posts: 1614
    • View Profile
Re: Links?
« Reply #1 on: May 02, 2018, 04:29:59 pm »
kLibc supports symlinks, but only with programs linked against kLIBC, basically everything compiled with GCC, so these symlinks don't work with much of OS/2, though on HPFS, they will work on Linux :)
These symlinks are kept in EAs.
There's also the TVFS file system (search on Hobbes) which does support symlinks at the file system level, but unluckily it seems to be incompatible with the kLibc symlinks.

Bogdan Szmalcownik

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 37
    • View Profile
Re: Links?
« Reply #2 on: May 07, 2018, 08:57:56 am »
The klibc seems to be unsupported. Symbolic links are not supported. The incomplete emulation by EA doesn't work across different file systems or on remote file systems. It seems to be derived from earlier code that faked this feature for emx. With JFS2 file systems there should be no reason for emulation. In comparsion MKS or SFU for Windows is usable, but klibc is very incomplete and experimental.

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 9
  • -Receive: 110
  • Posts: 1614
    • View Profile
Re: Links?
« Reply #3 on: May 08, 2018, 06:28:37 am »
kLIBC is mostly being supported by Bitwise with various fixes applied to the version that is installed with RPM/YUM along with libcx which has various extensions to kLIBC such as mmap support, better select() and other things.
The symbolic link support works surprisingly well but has its weaknesses. Not supported on all filesystems, the usual problems with EAs such as being easily lost.
While in theory JFS2 can support symlinks natively, in practice we don't have all the source or the manpower to backport the Linux or AIX forks.
It's what we currently have.

André Heldoorn

  • Sr. Member
  • ****
  • Thank You
  • -Given: 38
  • -Receive: 9
  • Posts: 371
    • View Profile
Re: Links?
« Reply #4 on: June 07, 2018, 11:07:24 am »
Quote
Shadows can come and go and might not necessarily survive a desktop restore. I would like something more permanent.

Any ideas?

Drag a WPShadow object which has to become permanent to a script, which appends the dragged object to another script which tries to (re-) create managed WPShadow objects after a WPS IPL, but only if the WPShadow doesn't already exist? WPTOOLS.DLL may be required to query existing objects, because OS/2 can create the same shadow twice:

Code: [Select]
/* MixedSamples.CMD */

CALL RxFuncAdd 'SysCreateShadow','RexxUtil','SysCreateShadow'
CALL RxFuncAdd 'SysSleep','RexxUtil','SysSleep'
CALL RxFuncAdd 'WPToolsLoadFuncs', 'WPTOOLS', 'WPToolsLoadFuncs'
CALL WPToolsLoadFuncs

IF SysCreateShadow('C:\CONFIG.SYS','<WP_DESKTOP>') THEN SAY 'Done!'
IF SysCreateShadow('C:\CONFIG.SYS','<WP_DESKTOP>') THEN SAY 'Done!'
SAY

SAY "Delay of 10 seconds, the WPS doesn't report new WPShadow objects that fast."
CALL SysSleep 10
SAY

iRetco=WPToolsFolderContent('<WP_DESKTOP>', 'list.')
IF iRetco=0 THEN EXIT

SAY 'Abstract objects on <WP_DESKTOP>:'
DO iObject=1 TO list.0
   Iretco=WPToolsQueryObject(list.Iobject,'szclass','sztitle','szsetupstring','szlocation')
   IF Iretco & szclass='WPShadow' THEN  SAY '"'szClass'", "'szTitle'", "'szSetupString'", "'szLocation'"'
END

EXIT
« Last Edit: June 07, 2018, 01:32:56 pm by André Heldoorn »

André Heldoorn

  • Sr. Member
  • ****
  • Thank You
  • -Given: 38
  • -Receive: 9
  • Posts: 371
    • View Profile
Re: Links?
« Reply #5 on: June 08, 2018, 10:33:38 am »
Quote
* MixedSamples.CMD */

0. Do delete both created shadows of x:\CONFIG.SYS afterwards.

1. FWIW, the sample is not a full solution. A minimal solution could be based on the sample. If a "permanent" shadow does not exist in a specific folder, according to a STARTUP.CMD query, then it has to be re-created. The sample creates 2 "identical" shadows, something you'd want to avoid, and shows the results of a query by using WPTOOLS.DLL.

2. If there's a new shadow which has to become "permanent", then I'd recommend editing the REXX code instead of writing some more complicated "permanent-shadow-manager".