Wapp

Check-in [fba858d541]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add the filelist.tcl example script.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: fba858d54106f444a225477be003590b6492ca7760e052b9ad897c6e9dc7cce0
User & Date: drh 2018-05-21 15:25:48.330
Context
2018-05-30
17:01
Update the built-in SQLite to the 3.24.0 beta. (check-in: 6036d4fc11 user: drh tags: trunk)
2018-05-21
15:25
Add the filelist.tcl example script. (check-in: fba858d541 user: drh tags: trunk)
2018-05-08
01:12
Fix a typo in the documentation. (check-in: 123ddf6cef user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Added examples/filelist.tcl.




























































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/wapptclsh
#
# Show all files in the same directory as the script.
#
package require wapp
proc wapp-page-env {} {
  wapp-allow-xorigin-params
  wapp-trim {
    <h1>Wapp Environment</h1>
    <pre>%html([wapp-debug-env])</pre>
  }
}
proc wapp-default {} {
  cd [file dir [wapp-param SCRIPT_FILENAME {}]]
  regsub {/[^/]+$} [wapp-param BASE_URL] {} base
  wapp-trim {
     <html>
     <body>
     <ol>
  }
  foreach file [lsort [glob -nocomplain *]] {
    if {[file isdir $file]} continue
    if {![file readable $file]} continue
    wapp-trim {
       <li><a href="%html($base/$file)">%html($file)</a></li>
    }
  }
  wapp-trim {</ol>\n}
}
wapp-start $argv