Subj : file_id.diz extraction function
To   : Ignatius
From : Ozz Nixon
Date : Sun Dec 31 2017 11:36 pm

Hello Ignatius.

I redesigned, this should work (may have a typo) but should show you the flaw.

I> --begin--

function DizExists(const fn:astr):boolean;
var
  T:Text;
  S:string;

begin
  star('Checking for description...'#29);
  S:='';
  if (pos('.zip',fn)<>0) then S:='unzip -L -o '
  else if (pos('.lzh',fn)<>0) then S:='lha e f '
  else if (pos('.arj',fn)<>0) then S:='arj e f '
  else if (pos('.rar',fn)<>0) then S:='unrar x -cl ';
  If (S<>'') then begin
     fpsystem(S+' file_id.diz '+         general.temppath+cstr(node)+'/ARC/
>/dev/null');
     If (exist('/home/rg/TEMP'+cstr(node)+'/ARC/file_id.diz')) then begin
        assign(T,'/home/rg/TEMP'+cstr(node)+'/ARC/file_id.diz');
        {$I-} reset(T); {$I+}
        if (IOResult<>0) then exit;
        star('Importing description.');
        While not EOF(T) do begin
           {$I-} Readln(T,S); {$I+}
           If IOResult=0 then {do something with S!!};
        End;
        erase(T);
     end;
  End;
I> --end--

So where it says: {do something with S!!} use "S" for whatever you need for
your BBS code. You should also handle "FILE_ID.DIZ" (uppercase) too.

Let me know if you need any help...
Ozz

--- GoldED+/W32 1.1.4.7
* Origin:  Home of Exchange BBS (QBBS Clone) and Rhenium Mailer  (1:275/301)