tldm-universe/Ardent/UV/APP.PROGS/FIX.FIL.RPTR

89 lines
2.6 KiB
Plaintext
Raw Normal View History

2024-09-09 21:51:08 +00:00
********************************************************************************
*
* Fix Remote pointers having filename more than 12 characters
*
* Module %M% Version %I% Date %H%
*
* (c) Copyright 1998 Ardent Software Inc. - All Rights Reserved
* This is unpublished proprietary source code of Ardent Software Inc.
* The copyright notice above does not evidence any actual or intended
* publication of such source code.
*
*******************************************************************************
*
* Maintenence log - insert most recent change descriptions at top
*
* Date.... GTAR# WHO Description.........................................
* 10/14/98 23801 SAP Change copyrights.
* 07/25/88 - - Maintenence log purged at 5.2.1, see release 5.1.10.
*
*******************************************************************************
$OPTIONS DEFAULT
*
* max number of characters of a dict file = sys5 limitation =14
* max number of characters for a file name = (sys5 limitation - 2) =12
*
equate SYS5.LIMITATION TO 14
equate MAX.FILE.CHAR TO SYS5.LIMITATION - 2
*
* Get only records from voc which are of type remote file pointers.
*
print "FIXING FILE NAMES OF REMOTE POINTERS EXCEEDING 14 CHARACTERS"
execute "SELECT VOC WITH TYPE LIKE f... OR TYPE LIKE F... AND F2 LIKE .../..." capturing dev.null
open 'VOC' to orig.voc.file else stop "Can't open VOC"
READ.NEXT.VOCF :
readnext id.f else
close orig.voc.file
stop "DONE"
end
read orig.voc.record from orig.voc.file, id.f else
print "Can not read record id ":id.f:" from VOC ; Skipping this record "
goto READ.NEXT.VOCF
end
*
* Parse 2 nd field and put path name in path and file name in filename
*
i=index(orig.voc.record<2>,'/',1)
j=i
loop
while i do
path = orig.voc.record<2>[1,j]
filename = orig.voc.record<2>[j+1,9999]
i=index(filename,'/',1)
j=j+i
repeat
*
* If file name is long to fix,get truncated filename from correct VOC file
*
if len(filename) > MAX.FILE.CHAR
then
gosub REPLACE.FILENAME
end
goto READ.NEXT.VOCF
REPLACE.FILENAME :
new.voc.filename=path:"VOC"
openpath new.voc.filename to new.voc.file else
print "Can't open VOC= ":new.voc.filename
return
end
read new.voc.record from new.voc.file, filename
then
orig.voc.record<2>=path:new.voc.record<2>
orig.voc.record<3>=path:new.voc.record<3>
write orig.voc.record to orig.voc.file, id.f
end
else
print "Can not read record id ":filename:" from ":new.voc.filename
print "VOC entry for ":id.f:" not updated"
end
close new.voc.file
return
*
* End of program
*