There is no command on the IBM i OS that allows you to do the IFS equivalent of WRKOBJLCK for the native file system.
Resolving The Problem
There is no command on the IBM i OS that allows you to do the IFS equivalent of WRKOBJLCK for the native file system. However, the following command source and RPGLE source will create a command that allows you to view lock information for an IFS directory or stream file. The output of the command will be a spooled file that contains information about jobs that are holding locks on an IFS object (file or directory) and the reason they have the lock.
|Caution: This is an example only. IBM accepts no responsibility for its correctness.|
Note: Unless otherwise specified, parameters should be passed as null-terminated strings.
Command source: Command name WRKLCK.
PARM KWD(PATH) TYPE(*CHAR) LEN(500)
RPGLE source: Program name WRKLCK
Dspaceloc S 3P 0
DPATH S 500
DCMD S 1024 INZ(' ')
DQUOTE S 1 INZ('''')
DCMDL S 15 0 INZ(1024)
DQCMDEXC PR EXTPGM('QCMDEXC')
DCMD 1024A OPTIONS(*VARSIZE) CONST
DCMDL 15p 5 CONST
C *ENTRY PLIST
C PARM PATH
C* PARM RTN
spaceloc = %scan(' ':path);
path = %subst(path:1:spaceloc);
cmd='CALL QP0FPTOS PARM(*LSTOBJREF '+ QUOTE + %trim(path) + QUOTE + ' +
QCMDEXC (CMD : %SIZE(CMD));
*INLR = *ON;
18 December 2019