(view source code of file.cmd as plain text)
/* List open files on server */call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs'
call LoadLsRxutFuncsNETFILE = 60
parse arg SrvName BasePath dummy
if dummy <> '' then call Syntax
if BasePath = '' then call Syntax
if pos( '?', SrvName ) > 0 then call Syntax
myRc = NetEnumerate(NETFILE, 'fileInfo', SrvName, BasePath)
if myRc <> '0' then do
say 'Got error from NetEnumerate() ' myRc
exit 9
endif fileInfo.count = 0 then do
say 'No files open on the server'
exit 0
endsay 'Number of open file entries: ' fileInfo.count
saydo i=1 to fileInfo.count
say fileInfo.i.username fileInfo.i.id fileInfo.i.permissions fileInfo.i.num_locks fileInfo.i.pathnameendexit 0
Syntax: procedure
saysay 'File'
say 'Show who has opened specified file'
saysay 'Usage: FILE \\server_name full_path_and_file_name'
exit 1
returnpage last modified: 2025-10-11; loaded in 0.0054 seconds