#!/usr/pkg/bin/rexx /*-----------------------------------------------------------------------------+ | Program name: | | | | Subject: make html files for ftp 1st, 2nd, 3d, nad 4th level | | for FreeBSD, NetBSD, and OpenBSD systems | | File name: make_xbsd_ftp.rexx | | | | Note: version 0.6 | | | | Category: Freeware, BSD Licenced | | | | Copyright (C) by Przemysław Pawełczyk Cracow, May 2007 | | E-Mail: pp_o2@o2.pl | | P2O2 WWW: http://pp.kv.net.pl | +-----------------------------------------------------------------------------*/ prog_ver = "0.6" bsd_sys = "FreeBSD" /* bsd_sys = "NetBSD" */ /* bsd_sys = "OpenBSD" */ if bsd_sys = "FreeBSD" then do bsd_short = "fbsd" bsd_col = "#990000" bsd_link = "ftp://ftp.FreeBSD.org/pub/FreeBSD/" end if bsd_sys = "NetBSD" then do bsd_short = "nbsd" bsd_col = "#006600" bsd_link = "ftp://ftp.netbsd.org/" end if bsd_sys = "OpenBSD" then do bsd_short = "obsd" bsd_col = "#000099" bsd_link = "ftp://ftp.openbsd.org/" end /*-----------------------------------------------------------------------------+ | | | FreeBSD | | | +-----------------------------------------------------------------------------*/ if bsd_sys = "FreeBSD" then do /*---------------------------------------------------------------------------+ | Exclusion list: Level 1 | +---------------------------------------------------------------------------*/ exclStem. = "" exclStem.1.1 = "development" exclStem.1.0 = 1 /*---------------------------------------------------------------------------+ | Exclusion list: Level 2 | +---------------------------------------------------------------------------*/ exclStem.2.1 = "distfiles" exclStem.2.2 = "local-distfiles" exclStem.2.3 = "patches" exclStem.2.4 = "advisories" exclStem.2.5 = "packages" exclStem.2.6 = "tools" exclStem.2.7 = "notices" exclStem.2.8 = "2.2-stable" exclStem.2.9 = "current" exclStem.2.10 = "sparc64" exclStem.2.11 = "powerpc" exclStem.2.12 = "pc98" exclStem.2.13 = "alpha" exclStem.2.0 = 13 /*---------------------------------------------------------------------------+ | Exclusion list: Level 3 | +---------------------------------------------------------------------------*/ exclStem.3.1 = "5.5-RELEASE" exclStem.3.2 = "2.2.9-RELEASE" exclStem.3.3 = "tmp" exclStem.3.4 = "ports" exclStem.3.5 = "src" exclStem.3.6 = "articles" exclStem.3.7 = "books" exclStem.3.8 = "packages-5-stable" exclStem.3.9 = "packages-5.5-release" exclStem.3.10 = "packages-4-stable" exclStem.3.11 = "packages-6-stable" exclStem.3.12 = "packages-6.1-release" exclStem.3.0 = 12 /*---------------------------------------------------------------------------+ | Exclusion list: Level 4 | +---------------------------------------------------------------------------*/ exclStem.4.1 = "" exclStem.4.0 = 1 /*---------------------------------------------------------------------------+ | Exclusion list: Level 5 | +---------------------------------------------------------------------------*/ exclStem.5.1 = "" exclStem.5.0 = 1 /*---------------------------------------------------------------------------+ | Color some items | +---------------------------------------------------------------------------*/ colStem. = "" colStem.1 = "ISO-IMAGES" colStem.2 = "books" colStem.3 = "articles" colStem.4 = "i386" colStem.0 = 4 colVar. = "" colVar.1 = "#ff0000" colVar.2 = "#009900" colVar.3 = "#009900" colVar.4 = "#ff00ff" colVar.0 = 4 end /*-----------------------------------------------------------------------------+ | | | FreeBSD Setting - End | | | +-----------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------+ | | | NetBSD | | | +-----------------------------------------------------------------------------*/ if bsd_sys = "NetBSD" then do /*---------------------------------------------------------------------------+ | Exclusion list: Level 1 | +---------------------------------------------------------------------------*/ exclStem. = "" exclStem.1.1 = "NetBSD-archive" exclStem.1.2 = "sup" exclStem.1.0 = 2 /*---------------------------------------------------------------------------+ | Exclusion list: Level 2 | +---------------------------------------------------------------------------*/ exclStem.2.1 = "arch" exclStem.2.2 = "misc" exclStem.2.3 = "distfiles" exclStem.2.4 = "NetBSD-2.0.2" exclStem.2.5 = "NetBSD-2.0.3" exclStem.2.6 = "NetBSD-2.1" exclStem.2.7 = "NetBSD-3.0.2" exclStem.2.8 = "NetBSD-release-2-0" exclStem.2.9 = "NetBSD-release-2-1" exclStem.2.10 = "NetBSD-release-3-0" exclStem.2.11 = "netbsd-2" exclStem.2.12 = "netbsd-2-0" exclStem.2.13 = "netbsd-2-1" exclStem.2.14 = "netbsd-3" exclStem.2.15 = "netbsd-3-0" exclStem.2.16 = "packages" exclStem.2.17 = "packages-2006Q1" exclStem.2.18 = "packages-2006Q2" exclStem.2.19 = "packages-2006Q3" exclStem.2.0 = 19 /*---------------------------------------------------------------------------+ | Exclusion list: Level 3 | +---------------------------------------------------------------------------*/ exclStem.3.1 = "src" exclStem.3.2 = "tar_files" exclStem.3.3 = "xsrc" exclStem.3.4 = "pkgsrc" exclStem.3.5 = "acorn26" exclStem.3.6 = "acorn32" exclStem.3.7 = "algor" exclStem.3.8 = "alpha" exclStem.3.9 = "amd64" exclStem.3.10 = "amiga" exclStem.3.11 = "arc" exclStem.3.12 = "atari" exclStem.3.13 = "cats" exclStem.3.14 = "cesfic" exclStem.3.15 = "cobalt" exclStem.3.16 = "dreamcast" exclStem.3.17 = "evbarm" exclStem.3.18 = "evbmips-mipseb" exclStem.3.19 = "evbmips-mipsel" exclStem.3.20 = "evbppc" exclStem.3.21 = "evbsh3-sh3eb" exclStem.3.22 = "evbsh3-sh3el" exclStem.3.23 = "evbsh5-sh5el" exclStem.3.24 = "hp300" exclStem.3.25 = "hp700" exclStem.3.26 = "hpcarm" exclStem.3.27 = "hpcmips" exclStem.3.28 = "hpcsh" exclStem.3.29 = "ibmnws" exclStem.3.30 = "iyonix" exclStem.3.31 = "luna68k" exclStem.3.32 = "mac68k" exclStem.3.33 = "macppc" exclStem.3.34 = "mipsco" exclStem.3.35 = "mmeye" exclStem.3.36 = "mvme68k" exclStem.3.37 = "mvmeppc" exclStem.3.38 = "netwinder" exclStem.3.39 = "news68k" exclStem.3.40 = "newsmips" exclStem.3.41 = "next68k" exclStem.3.42 = "ofppc" exclStem.3.43 = "pmax" exclStem.3.44 = "pmppc" exclStem.3.45 = "prep" exclStem.3.46 = "sandpoint" exclStem.3.47 = "sbmips-mipseb" exclStem.3.48 = "sbmips-mipsel" exclStem.3.49 = "sgimips" exclStem.3.50 = "shared" exclStem.3.51 = "shark" exclStem.3.52 = "sparc" exclStem.3.53 = "sparc64" exclStem.3.54 = "sun2" exclStem.3.55 = "sun3" exclStem.3.56 = "vax" exclStem.3.57 = "x68k" exclStem.3.0 = 57 /*---------------------------------------------------------------------------+ | Exclusion list: Level 4 | +---------------------------------------------------------------------------*/ exclStem.4.1 = "acorn26" exclStem.4.2 = "acorn32" exclStem.4.3 = "algor" exclStem.4.4 = "alpha" exclStem.4.5 = "amd64" exclStem.4.6 = "amiga" exclStem.4.7 = "arc" exclStem.4.8 = "atari" exclStem.4.9 = "cats" exclStem.4.10 = "cesfic" exclStem.4.11 = "cobalt" exclStem.4.12 = "dreamcast" exclStem.4.13 = "evbarm" exclStem.4.14 = "evbmips-mipseb" exclStem.4.15 = "evbmips-mipsel" exclStem.4.16 = "evbppc" exclStem.4.17 = "evbsh3-sh3eb" exclStem.4.18 = "evbsh3-sh3el" exclStem.4.19 = "evbsh5-sh5el" exclStem.4.20 = "hp300" exclStem.4.21 = "hp700" exclStem.4.22 = "hpcarm" exclStem.4.23 = "hpcmips" exclStem.4.24 = "hpcsh" exclStem.4.25 = "ibmnws" exclStem.4.26 = "iyonix" exclStem.4.27 = "luna68k" exclStem.4.28 = "mac68k" exclStem.4.29 = "macppc" exclStem.4.30 = "mipsco" exclStem.4.31 = "mmeye" exclStem.4.32 = "mvme68k" exclStem.4.33 = "mvmeppc" exclStem.4.34 = "netwinder" exclStem.4.35 = "news68k" exclStem.4.36 = "newsmips" exclStem.4.37 = "next68k" exclStem.4.38 = "ofppc" exclStem.4.39 = "pmax" exclStem.4.40 = "pmppc" exclStem.4.41 = "prep" exclStem.4.42 = "sandpoint" exclStem.4.43 = "sbmips-mipseb" exclStem.4.44 = "sbmips-mipsel" exclStem.4.45 = "sgimips" exclStem.4.46 = "shared" exclStem.4.47 = "shark" exclStem.4.48 = "sparc" exclStem.4.49 = "sparc64" exclStem.4.50 = "sun2" exclStem.4.51 = "sun3" exclStem.4.52 = "vax" exclStem.4.53 = "x68k" exclStem.4.54 = "evbsh3" exclStem.4.55 = "ews4800mips" exclStem.4.56 = "landisk" exclStem.4.57 = "sbmips" exclStem.4.58 = "zaurus" exclStem.4.0 = 58 /*---------------------------------------------------------------------------+ | Exclusion list: Level 5 | +---------------------------------------------------------------------------*/ exclStem.5.1 = "acorn26" exclStem.5.2 = "acorn32" exclStem.5.3 = "algor" exclStem.5.4 = "alpha" exclStem.5.5 = "amd64" exclStem.5.6 = "amiga" exclStem.5.7 = "arc" exclStem.5.8 = "atari" exclStem.5.9 = "cats" exclStem.5.10 = "cesfic" exclStem.5.11 = "cobalt" exclStem.5.12 = "dreamcast" exclStem.5.13 = "evbarm" exclStem.5.14 = "evbmips-mipseb" exclStem.5.15 = "evbmips-mipsel" exclStem.5.16 = "evbppc" exclStem.5.17 = "evbsh3-sh3eb" exclStem.5.18 = "evbsh3-sh3el" exclStem.5.19 = "evbsh5-sh5el" exclStem.5.20 = "hp300" exclStem.5.21 = "hp700" exclStem.5.22 = "hpcarm" exclStem.5.23 = "hpcmips" exclStem.5.24 = "hpcsh" exclStem.5.25 = "ibmnws" exclStem.5.26 = "iyonix" exclStem.5.27 = "luna68k" exclStem.5.28 = "mac68k" exclStem.5.29 = "macppc" exclStem.5.30 = "mipsco" exclStem.5.31 = "mmeye" exclStem.5.32 = "mvme68k" exclStem.5.33 = "mvmeppc" exclStem.5.34 = "netwinder" exclStem.5.35 = "news68k" exclStem.5.36 = "newsmips" exclStem.5.37 = "next68k" exclStem.5.38 = "ofppc" exclStem.5.39 = "pmax" exclStem.5.40 = "pmppc" exclStem.5.41 = "prep" exclStem.5.42 = "sandpoint" exclStem.5.43 = "sbmips-mipseb" exclStem.5.44 = "sbmips-mipsel" exclStem.5.45 = "sgimips" exclStem.5.46 = "shared" exclStem.5.47 = "shark" exclStem.5.48 = "sparc" exclStem.5.49 = "sparc64" exclStem.5.50 = "sun2" exclStem.5.51 = "sun3" exclStem.5.52 = "vax" exclStem.5.53 = "x68k" exclStem.5.54 = "evbsh3" exclStem.5.55 = "ews4800mips" exclStem.5.56 = "landisk" exclStem.5.57 = "sbmips" exclStem.5.58 = "zaurus" exclStem.5.0 = 58 /*---------------------------------------------------------------------------+ | Color some items | +---------------------------------------------------------------------------*/ colStem. = "" colStem.1 = "iso" colStem.2 = "i386" colStem.3 = "source" colStem.4 = "NetBSD-3.1" colStem.5 = "cdrom" colStem.6 = "livecd" colStem.0 = 6 colVar. = "" colVar.1 = "#ff0000" colVar.2 = "#ff00ff" colVar.3 = "#00aa00" colVar.4 = "#ff6347" colVar.5 = "#990000" colVar.6 = "#990000" colVar.0 = 6 end /*-----------------------------------------------------------------------------+ | | | NetBSD Setting - End | | | +-----------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------+ | | | OpenBSD Setting - Beginning | | | +-----------------------------------------------------------------------------*/ if bsd_sys = "OpenBSD" then do /*---------------------------------------------------------------------------+ | Exclusion list: Level 1 | +---------------------------------------------------------------------------*/ exclStem. = "" exclStem.1.1 = "Mirror" exclStem.1.0 = 1 /*---------------------------------------------------------------------------+ | Exclusion list: Level 2 | +---------------------------------------------------------------------------*/ exclStem.2.1 = "Bio-DiTRL" exclStem.2.0 = 1 /*---------------------------------------------------------------------------+ | Exclusion list: Level 3 | +---------------------------------------------------------------------------*/ exclStem.3.1 = "authors" exclStem.3.0 = 1 /*---------------------------------------------------------------------------+ | Exclusion list: Level 4 | +---------------------------------------------------------------------------*/ exclStem.4.1 = "" exclStem.4.0 = 1 /*---------------------------------------------------------------------------+ | Exclusion list: Level 5 | +---------------------------------------------------------------------------*/ exclStem.5.1 = "" exclStem.5.0 = 1 /*---------------------------------------------------------------------------+ | Color some items | +---------------------------------------------------------------------------*/ colStem. = "" colStem.1 = "Linux" colStem.2 = "clusters" colStem.3 = "books" colStem.4 = "FAQs" colStem.5 = "Source" colStem.0 = 5 colVar. = "" colVar.1 = "#990000" colVar.2 = "#ff00ff" colVar.3 = "#00aa00" colVar.4 = "#ff0000" colVar.5 = "#0000ff" colVar.0 = 5 end /*-----------------------------------------------------------------------------+ | | | OpenBSD Setting - End | | | +-----------------------------------------------------------------------------*/ parse arg ldepth if ldepth = "" then do say say " ...running make_"bsd_short"_ftp.rexx... " say "=====================================" say "no argument" say say "program make_"bsd_short"_ftp.rexx terminated" say "=====================================" say exit end say say "=====================================" say " ...running make_"bsd_short"_ftp.rexx... " say "=====================================" say "Time (start) = "time("E") say "-------------------------------------" /*-----------------------------------------------------------------------------+ | Constants | +-----------------------------------------------------------------------------*/ _LF = x2c('0A') /* line feed character, ending line in Unix */ say "Processing "bsd_sys" index file." say level_depth = ldepth /* max depth level of ftp directories */ level_char = "/" /* char defining depth level */ level_no = 0 /* number of level_char */ /*---------------------------------------------------------+ | Defining date | +---------------------------------------------------------*/ dateStr = date('N') parse var dateStr dayStr monStr yearStr todayDate = monStr" "dayStr", "yearStr /*-----------------------------------------------------------------------------+ | Defining file ftp.list | +-----------------------------------------------------------------------------*/ ftp_html = .stream~new("./"bsd_short"_ftp_"level_depth".html") ftp_list = .stream~new("./"bsd_short"_ftp.list") line_no = ftp_list~lines ftp_list_size = ftp_list~query("size") ftp_list_size_len = ftp_list_size~length if ftp_list_size_len < 10 then do b1int = ftp_list_size % 1000000 b1mod = ftp_list_size // 1000000 m1int = b1mod % 1000 k1mod = b1mod // 1000 end else do say "---------------------------------------------" say "Gigantic file to process. Program terminated." say "Bye!" say exit end if b1int = "" then str1 = "" else str1 = b1int~right(3,"0")"," if m1int = "" then str2 = "" else str2 = m1int~right(3,"0")"," if k1mod = "" then str3 = "" else str3 = k1mod~right(3,"0")" Bytes" ftp_list_str = str1 || str2 || str3 say "ftp index size = "ftp_list_str say "number of lines = "line_no say "directory level = "level_depth say /*-----------------------------------------------------------------------------+ | First part of HTML page | +-----------------------------------------------------------------------------*/ html_header_1 = "" ||, ''_LF ||, ''_LF ||, ''_LF ||, ''_LF ||, ''_LF ||, ''_LF ||, ''_LF ||, 'P2O2 Guide to 'bsd_sys' FTP'_LF ||, ''_LF ||, ''_LF ||, ''_LF ||, ''_LF ||, ''_LF ||, ''_LF ||, ' '_LF ||, ''_LF ||, '
'_LF ||, ''_LF ||, '

'_LF ||, ' The LearN@BSD Project'_LF ||, ' - P2O2 Guide to 'bsd_sys' FTP'_LF ||, '

'_LF ||, '
'_LF ||, ''_LF ||, '

Created - Apr 17, 2007  |  Modified: - 'todayDate'

'_LF ||, ''_LF ||, ''_LF ||, '

'_LF ||, ' P2O2''s WWW Homepage -> ', 'LearN@BSD Homepage -> ', 'P2O2 Guide to 'bsd_sys' FTP - ', 'Level 'level_depth''_LF ||, '

'_LF ||, '
'_LF ||, ''_LF ||, '

Version: 'prog_ver'

'_LF ||, '

'_LF ||, ' FTP SHORT DESCRIPTION
'_LF /*-----------------------------------------------------------------------------+ | Third part of HTML page | +-----------------------------------------------------------------------------*/ html_header_3 = "" ||, ' 2.) In 99.999% cases "click to open" means also "folded" but the directory was not set to "folded" option.
'_LF ||, ' 3.) "[folded]" means the directory was set to be "folded" when showing more FTP levels.'_LF ||, '

'_LF ||, ''_LF ||, '

'_LF ||, ' Select level page:', ' Level 1 ->'_LF ||, ' Level 2 ->'_LF ||, ' Level 3 ->'_LF ||, ' Level 4'_LF ||, '

'_LF ||, '
'_LF ||, ''_LF ||, '

'_LF ||, ' Level = 'level_depth''_LF ||, '

' _LF ||, ''_LF ||, ' '_LF ||, ' '_LF /*-----------------------------------------------------------------------------+ | Second part of HTML page | +-----------------------------------------------------------------------------*/ if bsd_sys = "FreeBSD" then do html_header_2 = "" ||, ' 1.) 'bsd_sys' ls-lR file DO NOT provides /pub/'bsd_sys' directories.
'_LF ||, ' 2.) Lines in ls-lR or 'bsd_short'_ftp.list MUST start with pub/ directory.

'_LF ||, ' P2O2 LEGEND
'_LF ||, ' 1.) /ISO-IMAGES are displayed in different colors.
'_LF end if bsd_sys = "OpenBSD" then do html_header_2 = "" ||, ' 1.) 'bsd_sys' ls-lR file DO NOT provides /pub/'bsd_sys' directories.
'_LF ||, ' 2.) Lines in ls-lR or 'bsd_short'_ftp.list files MUST start with pub/ directory.

'_LF ||, ' P2O2 LEGEND
'_LF ||, ' 1.) /books, /Linux, /clusters, /FAQs, /Source are displayed in different colors.
'_LF end if bsd_sys = "NetBSD" then do html_header_2 = "" ||, ' 1.) This page is complementary to Download Systems
'_LF ||, ' 2.) NetBSD-daily snapshots are created on daily basis. Some corresponding links below can be found invalid.
'_LF ||, ' 3.) Releases /source(s) are placed within /arch directories. Be aware!
'_LF ||, ' 4.) ISO images of stable releases have separate directory on second level in /NetBSD/iso.
'_LF ||, ' 5.) ISO images of current snapshots are placed in /arch directories on 4th level of /NetBSD-daily.
'_LF ||, ' 6.) /packages-2007Q1 etc. contains application binaries: /packages-2007Q1/NetBSD-3.1/i386/All
'_LF ||, ' 7.) /pkgsrc-2007Q1 etc. contains application compilation recipes in tar.(gz/bz2) form

'_LF ||, ' P2O2 LEGEND
'_LF ||, ' 1.) /i386, /source, /iso, /cdrom, /livecd, /NetBSD-3.1 are displayed in different colors.
'_LF end /*-----------------------------------------------------------------------------+ | Footer part of HTML page | +-----------------------------------------------------------------------------*/ html_footer = "" ||, '
'_LF ||, '
'_LF ||, ''_LF ||, '
'_LF ||, ''_LF ||, '
'_LF ||, '

'_LF ||, ''_LF ||, ' Przemysław Pawełczyk - Cracow, Poland '_LF ||, '  '_LF ||, '[Static website generated with Rexx scripts in NetBSD 3.1]'_LF ||, '

'_LF ||, ''_LF ||, ''_LF i = 1 levelStem. = "" /*-----------------------------------------------------------------------------+ | >>>>>>>>>>>>>>>>>>>>>>>>> Main program body <<<<<<<<<<<<<<<<<<<<<<<<<<<<< | +-----------------------------------------------------------------------------*/ do total = 1 to line_no oneline = ftp_list~linein /* readin a line */ path_dir_name = oneline~strip("t", ":") /* path_name w/o ":" on end */ if bsd_sys = "FreeBSD" then do ftp_path_dir = path_dir_name~substr(5) /* path_name w/o "pub/" */ end else do ftp_path_dir = path_dir_name /* path_name w/ "pub/" */ end level_no = oneline~countstr(level_char) /* number of "/" char */ last_pos = oneline~lastpos(level_char) /* last position of "/" */ oneline_len = path_dir_name~length dir_len = oneline_len - last_pos /* last dir_name length */ dir_name = path_dir_name~right(dir_len) /* last dir name */ dir_name = strip(dir_name) if level_no = 1 then do lev1_start = last_pos + 1 lev1_long = dir_len end if level_no = 2 then do lev2_start = last_pos + 1 lev2_long = dir_len end if level_no = 3 then do lev3_start = last_pos + 1 lev3_long = dir_len end if level_no = 4 then do lev4_start = last_pos + 1 lev4_long = dir_len end if level_no = 5 then do lev5_start = last_pos + 1 lev5_long = dir_len end /*-----------------------------------------------------------------------------+ | making lines for html output file | +-----------------------------------------------------------------------------*/ /*---------------------------------------------------------+ | Processing Level 1... | +---------------------------------------------------------*/ if level_no = 1 then do exclExists_1 = 0 do j = 1 to exclStem.1.0 if exclStem.1.j = dir_name then exclExists_1 = 1 end /* do j = 1 */ if exclExists_1 = 0 then dir_name_descr = ' - main directory - click to open FTP' else dir_name_descr = ' - [folded]' do q = 1 to colStem.0 if colStem.q = dir_name then dir_col = colVar.q else dir_col = "#0000ff" end levelStem_tmp = '1-> ' ||, '', ''dir_name'' levelStem.i = levelStem_tmp''dir_name_descr'
' i = i + 1 end /*if level_no = 1 */ /*---------------------------------------------------------+ | Processing Level 2... | +---------------------------------------------------------*/ if level_no = 2 then do if level_depth < level_no then iterate excl_1 = substr(path_dir_name, lev1_start, lev1_long) exclExists_2 = 0 exclExists_1 = 0 do j = 1 to exclStem.2.0 do k = 1 to exclStem.1.0 if excl_1 = exclStem.1.k then exclExists_1 = 1 end if exclStem.2.j = dir_name then exclExists_2 = 1 end /* do j = 1 */ if exclExists_1 = 1 then iterate if exclExists_2 = 0 then dir_name_descr = ' - click to open FTP' else dir_name_descr = ' - [folded]' do p = 1 to colStem.0 if colStem.p = dir_name then do dir_col = colVar.p leave end else dir_col = "#0000FF" end levelStem_tmp = '2-----> ' ||, '', ''dir_name'' levelStem.i = levelStem_tmp''dir_name_descr'
' i = i + 1 end /*if level_no = 2 */ /*---------------------------------------------------------+ | Processing Level 3... | +---------------------------------------------------------*/ if level_no = 3 then do if level_depth < level_no then iterate excl_1 = substr(path_dir_name, lev1_start, lev1_long) excl_2 = substr(path_dir_name, lev2_start, lev2_long) exclExists_3 = 0 exclExists_2 = 0 exclExists_1 = 0 do j = 1 to exclStem.3.0 do k = 1 to exclStem.2.0 do m = 1 to exclStem.1.0 if excl_1 = exclStem.1.m then exclExists_1 = 1 end if excl_2 = exclStem.2.k then exclExists_2 = 1 end if exclStem.3.j = dir_name then exclExists_3 = 1 end /* do j = 1 */ if exclExists_1 = 1 then iterate if exclExists_2 = 1 then iterate if exclExists_3 = 0 then dir_name_descr = ' - click to open FTP' else dir_name_descr = '- [folded]' do q = 1 to colStem.0 if colStem.q = dir_name then do dir_col = colVar.q leave end else dir_col = "#0000FF" end levelStem_tmp = '3---------> ' ||, '', ''dir_name'' levelStem.i = levelStem_tmp''dir_name_descr'
' i = i + 1 end /*if level_no = 3 */ /*---------------------------------------------------------+ | Processing Level 4... | +---------------------------------------------------------*/ if level_no = 4 then do if level_depth < level_no then iterate excl_1 = substr(path_dir_name, lev1_start, lev1_long) excl_2 = substr(path_dir_name, lev2_start, lev2_long) excl_3 = substr(path_dir_name, lev3_start, lev3_long) exclExists_4 = 0 exclExists_3 = 0 exclExists_2 = 0 exclExists_1 = 0 do n = 1 to exclStem.4.0 do j = 1 to exclStem.3.0 do k = 1 to exclStem.2.0 do m = 1 to exclStem.1.0 if excl_1 = exclStem.1.m then exclExists_1 = 1 end if excl_2 = exclStem.2.k then exclExists_2 = 1 end if excl_3 = exclStem.3.j then exclExists_3 = 1 end /* do j = 1 */ if exclStem.4.n = dir_name then exclExists_4 = 1 end /* do j = 1 */ if exclExists_1 = 1 then iterate if exclExists_2 = 1 then iterate if exclExists_3 = 1 then iterate if exclExists_4 = 0 then dir_name_descr = ' - click to open FTP' else dir_name_descr = ' - [folded]' do q = 1 to colStem.0 if colStem.q = dir_name then do dir_col = colVar.q leave end else dir_col = "#0000FF" end levelStem_tmp = '4-------------> ' ||, '', ''dir_name'' levelStem.i = levelStem_tmp''dir_name_descr'
' i = i + 1 end /*if level_no = 4 */ /*---------------------------------------------------------+ | Processing Level 5... | +---------------------------------------------------------*/ if level_no = 5 then do if level_depth < level_no then iterate excl_1 = substr(path_dir_name, lev1_start, lev1_long) excl_2 = substr(path_dir_name, lev2_start, lev2_long) excl_3 = substr(path_dir_name, lev3_start, lev3_long) excl_4 = substr(path_dir_name, lev4_start, lev4_long) exclExists_5 = 0 exclExists_4 = 0 exclExists_3 = 0 exclExists_2 = 0 exclExists_1 = 0 do h = 1 to exclStem.5.0 do n = 1 to exclStem.4.0 do j = 1 to exclStem.3.0 do k = 1 to exclStem.2.0 do m = 1 to exclStem.1.0 if excl_1 = exclStem.1.m then exclExists_1 = 1 end /* do m = 1 */ if excl_2 = exclStem.2.k then exclExists_2 = 1 end /* do k = 1 */ if excl_3 = exclStem.3.j then exclExists_3 = 1 end /* do j = 1 */ if excl_4 = exclStem.4.n then exclExists_4 = 1 end /* do n = 1 */ if exclStem.5.n = dir_name then exclExists_5 = 1 end /* do h = 1 */ if exclExists_1 = 1 then iterate if exclExists_2 = 1 then iterate if exclExists_3 = 1 then iterate if exclExists_4 = 1 then iterate if exclExists_5 = 0 then dir_name_descr = ' - click to open FTP' else dir_name_descr = ' - [folded]' do q = 1 to colStem.0 if colStem.q = dir_name then do dir_col = colVar.q leave end else dir_col = "#0000FF" end levelStem_tmp = '5-----------------> ' ||, '', ''dir_name'' levelStem.i = levelStem_tmp''dir_name_descr'
' i = i + 1 end /*if level_no = 5 */ end levelStem.0 = i - 1 say "levelStem.0 = "levelStem.0 /*-----------------------------------------------------------------------------+ | making html file: ftpx.html x - 1,2,3,4 | +-----------------------------------------------------------------------------*/ ftp_html~lineout( html_header_1 ) ftp_html~lineout( html_header_2 ) ftp_html~lineout( html_header_3 ) do i = 1 to levelStem.0 ftp_html~lineout( levelStem.i ) end ftp_html~lineout( html_footer ) ftp_html~close ftp_list~close drop levelStem. colStem. colVar. exclStem /*-----------------------------------------------------------------------------+ | >>>>>>>>>>>>>>>>>>>>>> End of Main program body <<<<<<<<<<<<<<<<<<<<<<<<<< | +-----------------------------------------------------------------------------*/ say "Time (lapse) = "time("R") "sec" say "=====================================" say exit