/* CONVERT_SUBJECT.CMD -- Convert 4OS2 descriptions to FILES.BBS */
/*
* This is a REXX script that reads the .SUBJECT extended attributes
* of files and writes appropriate FILES.BBS files for the benefit of
* certain backward utilities that haven't converted to using .SUBJECT
* EAs yet (such as 4DOS). Lines are only ever appended to the FILES.BBS
* files, so no existing FILES.BBS contents will be overwritten.
*
* (c) Copyright 1999 Jonathan de Boyne Pollard. All rights reserved.
*
* Permission is hereby granted for you to use, copy, modify, and redistribute
* this script to your heart's content, as long as you make no money from
* doing so, and as long as you realise that I accept no responsibility for
* whatever posession or use of this script may do to your machine, data,
* cat, or marital status.
*
* NOTE: This script requires Object REXX.
*/
call RxFuncAdd 'SysFileTree','RexxUtil','SysFileTree'
call RxFuncAdd 'SysGetEA','RexxUtil','SysGetEA'
call RxFuncAdd 'SysGetMessage','RexxUtil','SysGetMessage'
if SysFileTree('*', 'names', 'SBO') == 0 then
do i = 1 to names.0
error = SysGetEA(names.i, ".SUBJECT", "subject")
if error \= 0 then do
say SysGetMessage(error,,names.i) ' "'names.i'"'
iterate
end
if subject \= "" then do
say names.i
len = subject~substr(3,2)~reverse()~c2d()
description = subject~substr(5,len)
if len > 0 then do
path = filespec("Drive",names.i)||filespec("Path",names.i)
FilesBBS = .stream~new(path||"FILES.BBS")
FilesBBS~open("write append")
FilesBBS~lineout(filespec("Name",names.i)||" "||description)
FilesBBS~close()
end
end
end
else
say Error reading the directory tree.
exit
/* ¯ JdeBP ® */
--- FleetStreet 1.22 NR
209/7211
911
801/161
* Origin: JdeBP's point, using Squish (2:257/609.3)
|