You are viewing a plain text version of this content. The canonical link for it is here.
Posted to site-cvs@tcl.apache.org by ro...@apache.org on 2004/07/09 19:42:37 UTC

cvs commit: tcl-site/websh/examples emailform.html emailform.ws3 emailform_ws3.txt memory.html memory.ws3 memory_ws3.txt session_form.html session_form.ws3 session_form_ws3.txt

ronnie      2004/07/09 10:42:37

  Modified:    websh/examples emailform.html emailform.ws3
                        emailform_ws3.txt memory.html memory.ws3
                        memory_ws3.txt session_form.html session_form.ws3
                        session_form_ws3.txt
  Log:
  - all examples use same temp directory
  
  Revision  Changes    Path
  1.6       +5 -1      tcl-site/websh/examples/emailform.html
  
  Index: emailform.html
  ===================================================================
  RCS file: /home/cvs/tcl-site/websh/examples/emailform.html,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- emailform.html	7 Jul 2004 10:27:23 -0000	1.5
  +++ emailform.html	9 Jul 2004 17:42:37 -0000	1.6
  @@ -30,8 +30,12 @@
   <I><FONT COLOR="#B22222"># define where to send log messages to. Here we use a file
   </FONT></I><I><FONT COLOR="#B22222"># and again define a log destination based filter, which is again
   </FONT></I><I><FONT COLOR="#B22222"># &quot;*.-debug&quot; as above
  -</FONT></I>web::logdest add *.-debug <B><FONT COLOR="#A020F0">file</FONT></B> /tmp/emailform.log
  +</FONT></I>web::logdest add *.-debug <B><FONT COLOR="#A020F0">file</FONT></B> /tmp/websh/emailform.log
   
  +<I><FONT COLOR="#B22222"># because log directory might not exist in this environment
  +</FONT></I><I><FONT COLOR="#B22222"># (note: in a production environment you make sure that this exists 
  +</FONT></I><I><FONT COLOR="#B22222"># at install time. You don't want to create that directory with every request)
  +</FONT></I><B><FONT COLOR="#A020F0">catch</FONT></B> {<B><FONT COLOR="#A020F0">file</FONT></B> mkdir /tmp/websh}
   
   <I><FONT COLOR="#B22222"># utility command to handle an HTML page
   </FONT></I><B><FONT COLOR="#A020F0">proc</FONT></B> <B><FONT COLOR="#0000FF">page</FONT></B> {<FONT COLOR="#B8860B">title code</FONT>} {
  
  
  
  1.6       +5 -1      tcl-site/websh/examples/emailform.ws3
  
  Index: emailform.ws3
  ===================================================================
  RCS file: /home/cvs/tcl-site/websh/examples/emailform.ws3,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- emailform.ws3	7 Jul 2004 10:23:42 -0000	1.5
  +++ emailform.ws3	9 Jul 2004 17:42:37 -0000	1.6
  @@ -19,8 +19,12 @@
   # define where to send log messages to. Here we use a file
   # and again define a log destination based filter, which is again
   # "*.-debug" as above
  -web::logdest add *.-debug file /tmp/emailform.log
  +web::logdest add *.-debug file /tmp/websh/emailform.log
   
  +# because log directory might not exist in this environment
  +# (note: in a production environment you make sure that this exists 
  +# at install time. You don't want to create that directory with every request)
  +catch {file mkdir /tmp/websh}
   
   # utility command to handle an HTML page
   proc page {title code} {
  
  
  
  1.6       +5 -1      tcl-site/websh/examples/emailform_ws3.txt
  
  Index: emailform_ws3.txt
  ===================================================================
  RCS file: /home/cvs/tcl-site/websh/examples/emailform_ws3.txt,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- emailform_ws3.txt	7 Jul 2004 10:27:23 -0000	1.5
  +++ emailform_ws3.txt	9 Jul 2004 17:42:37 -0000	1.6
  @@ -19,8 +19,12 @@
   # define where to send log messages to. Here we use a file
   # and again define a log destination based filter, which is again
   # "*.-debug" as above
  -web::logdest add *.-debug file /tmp/emailform.log
  +web::logdest add *.-debug file /tmp/websh/emailform.log
   
  +# because log directory might not exist in this environment
  +# (note: in a production environment you make sure that this exists 
  +# at install time. You don't want to create that directory with every request)
  +catch {file mkdir /tmp/websh}
   
   # utility command to handle an HTML page
   proc page {title code} {
  
  
  
  1.5       +9 -5      tcl-site/websh/examples/memory.html
  
  Index: memory.html
  ===================================================================
  RCS file: /home/cvs/tcl-site/websh/examples/memory.html,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- memory.html	29 Jul 2002 21:30:16 -0000	1.4
  +++ memory.html	9 Jul 2004 17:42:37 -0000	1.5
  @@ -35,7 +35,7 @@
   </FONT></I>
   <I><FONT COLOR="#B22222"># turn logging on
   </FONT></I><I><FONT COLOR="#B22222">#web::logfilter add memory.-debug
  -</FONT></I><I><FONT COLOR="#B22222">#web::logdest add memory.-debug file [file join / tmp memory.log]
  +</FONT></I><I><FONT COLOR="#B22222">#web::logdest add memory.-debug file [file join / tmp websh memory.log]
   </FONT></I>
   <I><FONT COLOR="#B22222"># config: map level number to X-Y dimensions
   </FONT></I><B><FONT COLOR="#A020F0">set</FONT></B> _levels(1) [<B><FONT COLOR="#A020F0">list</FONT></B> 1 2]
  @@ -47,11 +47,15 @@
   <B><FONT COLOR="#A020F0">set</FONT></B> _levels(7) [<B><FONT COLOR="#A020F0">list</FONT></B> 6 9]
   
   <I><FONT COLOR="#B22222"># setup file context
  -</FONT></I>web::filecontext mctx -path [<B><FONT COLOR="#A020F0">file</FONT></B> <B><FONT COLOR="#A020F0">join</FONT></B> / tmp %s.ctx]
  -<I><FONT COLOR="#B22222"># hack ot make the filecontext work
  -</FONT></I><B><FONT COLOR="#A020F0">if</FONT></B> {![<B><FONT COLOR="#A020F0">file</FONT></B> exists [<B><FONT COLOR="#A020F0">file</FONT></B> <B><FONT COLOR="#A020F0">join</FONT></B> / tmp memory.ctx]]} {
  +</FONT></I>web::filecontext mctx -path /tmp/websh/%s.ctx
  +<B><FONT COLOR="#A020F0">if</FONT></B> {![<B><FONT COLOR="#A020F0">file</FONT></B> exists /tmp/websh/memory.ctx]} {
       <B><FONT COLOR="#A020F0">catch</FONT></B> {
  -	close [<B><FONT COLOR="#A020F0">open</FONT></B> [<B><FONT COLOR="#A020F0">file</FONT></B> <B><FONT COLOR="#A020F0">join</FONT></B> / tmp memory.ctx] w]
  +	<I><FONT COLOR="#B22222"># make sure context directory exists
  +</FONT></I>	<I><FONT COLOR="#B22222"># (note: in a production environment you make sure that this exists 
  +</FONT></I>	<I><FONT COLOR="#B22222"># at install time. You don't want to create that directory with every request)
  +</FONT></I>	<B><FONT COLOR="#A020F0">file</FONT></B> mkdir /tmp/websh
  +	<I><FONT COLOR="#B22222"># hack ot make the filecontext work
  +</FONT></I>	close [<B><FONT COLOR="#A020F0">open</FONT></B> /tmp/websh/memory.ctx w]
       }
   }
   
  
  
  
  1.6       +9 -5      tcl-site/websh/examples/memory.ws3
  
  Index: memory.ws3
  ===================================================================
  RCS file: /home/cvs/tcl-site/websh/examples/memory.ws3,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- memory.ws3	29 Jul 2002 21:30:16 -0000	1.5
  +++ memory.ws3	9 Jul 2004 17:42:37 -0000	1.6
  @@ -24,7 +24,7 @@
   
   # turn logging on
   #web::logfilter add memory.-debug
  -#web::logdest add memory.-debug file [file join / tmp memory.log]
  +#web::logdest add memory.-debug file [file join / tmp websh memory.log]
   
   # config: map level number to X-Y dimensions
   set _levels(1) [list 1 2]
  @@ -36,11 +36,15 @@
   set _levels(7) [list 6 9]
   
   # setup file context
  -web::filecontext mctx -path [file join / tmp %s.ctx]
  -# hack ot make the filecontext work
  -if {![file exists [file join / tmp memory.ctx]]} {
  +web::filecontext mctx -path /tmp/websh/%s.ctx
  +if {![file exists /tmp/websh/memory.ctx]} {
       catch {
  -	close [open [file join / tmp memory.ctx] w]
  +	# make sure context directory exists
  +	# (note: in a production environment you make sure that this exists 
  +	# at install time. You don't want to create that directory with every request)
  +	file mkdir /tmp/websh
  +	# hack ot make the filecontext work
  +	close [open /tmp/websh/memory.ctx w]
       }
   }
   
  
  
  
  1.5       +9 -5      tcl-site/websh/examples/memory_ws3.txt
  
  Index: memory_ws3.txt
  ===================================================================
  RCS file: /home/cvs/tcl-site/websh/examples/memory_ws3.txt,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- memory_ws3.txt	29 Jul 2002 21:30:16 -0000	1.4
  +++ memory_ws3.txt	9 Jul 2004 17:42:37 -0000	1.5
  @@ -24,7 +24,7 @@
   
   # turn logging on
   #web::logfilter add memory.-debug
  -#web::logdest add memory.-debug file [file join / tmp memory.log]
  +#web::logdest add memory.-debug file [file join / tmp websh memory.log]
   
   # config: map level number to X-Y dimensions
   set _levels(1) [list 1 2]
  @@ -36,11 +36,15 @@
   set _levels(7) [list 6 9]
   
   # setup file context
  -web::filecontext mctx -path [file join / tmp %s.ctx]
  -# hack ot make the filecontext work
  -if {![file exists [file join / tmp memory.ctx]]} {
  +web::filecontext mctx -path /tmp/websh/%s.ctx
  +if {![file exists /tmp/websh/memory.ctx]} {
       catch {
  -	close [open [file join / tmp memory.ctx] w]
  +	# make sure context directory exists
  +	# (note: in a production environment you make sure that this exists 
  +	# at install time. You don't want to create that directory with every request)
  +	file mkdir /tmp/websh
  +	# hack ot make the filecontext work
  +	close [open /tmp/websh/memory.ctx w]
       }
   }
   
  
  
  
  1.3       +1 -1      tcl-site/websh/examples/session_form.html
  
  Index: session_form.html
  ===================================================================
  RCS file: /home/cvs/tcl-site/websh/examples/session_form.html,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- session_form.html	29 Jul 2002 21:24:26 -0000	1.2
  +++ session_form.html	9 Jul 2004 17:42:37 -0000	1.3
  @@ -23,7 +23,7 @@
   
   <I><FONT COLOR="#B22222"># Now set some configuration variables. Usually put the session
   </FONT></I><I><FONT COLOR="#B22222"># state files in a directory not accessible through the Web server.
  -</FONT></I>config::cset stateDirectory /tmp/webshstate/
  +</FONT></I>config::cset stateDirectory /tmp/websh/state/
   
   <I><FONT COLOR="#B22222"># Create a file counter that generates the session ids. We take
   </FONT></I><I><FONT COLOR="#B22222"># here an easy number generator, which produces sequential numbers
  
  
  
  1.5       +1 -1      tcl-site/websh/examples/session_form.ws3
  
  Index: session_form.ws3
  ===================================================================
  RCS file: /home/cvs/tcl-site/websh/examples/session_form.ws3,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- session_form.ws3	29 Jul 2002 21:24:26 -0000	1.4
  +++ session_form.ws3	9 Jul 2004 17:42:37 -0000	1.5
  @@ -12,7 +12,7 @@
   
   # Now set some configuration variables. Usually put the session
   # state files in a directory not accessible through the Web server.
  -config::cset stateDirectory /tmp/webshstate/
  +config::cset stateDirectory /tmp/websh/state/
   
   # Create a file counter that generates the session ids. We take
   # here an easy number generator, which produces sequential numbers
  
  
  
  1.3       +1 -1      tcl-site/websh/examples/session_form_ws3.txt
  
  Index: session_form_ws3.txt
  ===================================================================
  RCS file: /home/cvs/tcl-site/websh/examples/session_form_ws3.txt,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- session_form_ws3.txt	29 Jul 2002 21:24:26 -0000	1.2
  +++ session_form_ws3.txt	9 Jul 2004 17:42:37 -0000	1.3
  @@ -12,7 +12,7 @@
   
   # Now set some configuration variables. Usually put the session
   # state files in a directory not accessible through the Web server.
  -config::cset stateDirectory /tmp/webshstate/
  +config::cset stateDirectory /tmp/websh/state/
   
   # Create a file counter that generates the session ids. We take
   # here an easy number generator, which produces sequential numbers
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: site-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: site-cvs-help@tcl.apache.org