/**/
call lineout ,'CONTENT-TYPE: text/html'
call lineout ,''
Dir = Value('PATH_TRANSLATED',,'OS2ENVIRONMENT')
Root = Value('PATH_INFO',,'OS2ENVIRONMENT')
Script = Value('SCRIPT_NAME',,'OS2ENVIRONMENT')

call lineout ,'Directory' Dir'<P>'
call Lineout ,'Root' Root'<P>'
call lineout ,'Script' Script'<p>'
call lineout ,'<pre>'
If Root <> '/' then do /* Root is in Unix format */
    Back=Substr(Root,1,lastpos('/',Root,Length(Root)-1))
    call lineout ,'<P><A HREF="'Script||Back'"> 'Left("..",25)' Back</A>'
end
Dir=Translate(Dir,'\','/') /* Path is in Unix format */
rc = SysFileTree(Dir, List, 'B')
call lineout , 'Found' list.0
Do i=1 to list.0
/*    call lineout ,List.i */
    parse var List.i Date Time Size Attr File
    File = substr(File,Lastpos('\',File)+1)
    path=Root||File
    If (substr(attr,2,1) == 'D') then do
        Link='<A HREF="'Script||path'/">'
    end
    Else Link='<A HREF="'path'">'
    call lineout ,'<P>'Right(Date,8) Right(Time,8) Right(Size,8) Link||File'</A>'
end
call lineout ,'</pre>'
return 0