cmdr
Check-in [06c0827602]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

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

Overview
Comment:Fix bug in history mgmt for a save-file in a directory. Ensure that the directory exists before writing/creating the file itself.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 06c082760252f0c1156573430264a13e28c144b9
User & Date: andreask 2015-03-06 20:44:51
Context
2015-04-17
05:47
Bring new docs into the trunk. check-in: 6cf097e45a user: aku tags: trunk
01:10
Started to fill in the documentation for packages 'ask', 'color', 'tty', and 'pager' check-in: 912d950350 user: andreask tags: doc-expansion
2015-03-10
03:01
Got fix for history check-in: a94ac7b701 user: aku tags: more-vtypes
2015-03-06
20:44
Fix bug in history mgmt for a save-file in a directory. Ensure that the directory exists before writing/creating the file itself. check-in: 06c0827602 user: andreask tags: trunk
01:54
cmdr::actor - Fixed issue with -extend of common blocks. The extended block can be missing. Then the operation is a plain set. Bumped to version 1.3.1 check-in: c14bea9a61 user: andreask tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to history.tcl.

   243    243       debug.cmdr/history {}
   244    244       variable file
   245    245       variable cache
   246    246   
   247    247       debug.cmdr/history {file      = $file}
   248    248       debug.cmdr/history {cache len = [llength $cache]}
   249    249   
          250  +    file mkdir [file dirname $file]
   250    251       fileutil::appendToFile $file [lindex $cache end]\n
   251    252       return
   252    253   }
   253    254   
   254    255   proc ::cmdr::history::SaveAll {} {
   255    256       debug.cmdr/history {}
   256    257   
................................................................................
   269    270   	append contents "#limit=$limit\n"
   270    271       }
   271    272   
   272    273       if {[llength $cache]} {
   273    274   	append contents "[join $cache \n]\n"
   274    275       }
   275    276   
          277  +    file mkdir [file dirname $file]
   276    278       fileutil::writeFile $file $contents
   277    279       return
   278    280   }
   279    281   
   280    282   proc ::cmdr::history::Load {} {
   281    283       CheckActive
   282    284   
................................................................................
   413    415       } else {
   414    416   	return "Keep $limit entries"
   415    417       }
   416    418   }
   417    419   
   418    420   # # ## ### ##### ######## ############# #####################
   419    421   ## Ready
   420         -package provide cmdr::history 0
          422  +package provide cmdr::history 0.1
   421    423   return