Recursive directory list

HTML/OS Add comments

<<### HTML/OS code by webHauser /#

FUNCTION dirall(current_folder)
LOCALS files, files_row DO
DISPLAY “<ul>” /DISPLAY
files=SYSLS(current_folder)
FOR NAME=files ROWNAME=files_row DO
  if files_row[4]=”DIR” then
      source_dir=current_folder+files_row[1]+’/’
      x=dirall(source_dir)
  ELIF files_row[4]=”FILE” then
      source_file=current_folder+files_row[1]
      DISPLAY “<li>” + source_file /DISPLAY
  /IF
/FOR
DISPLAY “</ul>” /DISPLAY
/FUNCTION>>

<html>
<<dirall(”/”)>>
</html>

Leave a Reply

You must be logged in to post a comment.

WebSite Powered by webHauser
Entries RSS Comments RSS Login