cmdr
Check-in [06c0827602]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.

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 Unified Diffs Ignore Whitespace Patch

Changes to history.tcl.

243
244
245
246
247
248
249

250
251
252
253
254
255
256
...
269
270
271
272
273
274
275

276
277
278
279
280
281
282
...
413
414
415
416
417
418
419
420
421
    debug.cmdr/history {}
    variable file
    variable cache

    debug.cmdr/history {file      = $file}
    debug.cmdr/history {cache len = [llength $cache]}


    fileutil::appendToFile $file [lindex $cache end]\n
    return
}

proc ::cmdr::history::SaveAll {} {
    debug.cmdr/history {}

................................................................................
	append contents "#limit=$limit\n"
    }

    if {[llength $cache]} {
	append contents "[join $cache \n]\n"
    }


    fileutil::writeFile $file $contents
    return
}

proc ::cmdr::history::Load {} {
    CheckActive

................................................................................
    } else {
	return "Keep $limit entries"
    }
}

# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::history 0
return






>







 







>







 







|

243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
...
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
...
415
416
417
418
419
420
421
422
423
    debug.cmdr/history {}
    variable file
    variable cache

    debug.cmdr/history {file      = $file}
    debug.cmdr/history {cache len = [llength $cache]}

    file mkdir [file dirname $file]
    fileutil::appendToFile $file [lindex $cache end]\n
    return
}

proc ::cmdr::history::SaveAll {} {
    debug.cmdr/history {}

................................................................................
	append contents "#limit=$limit\n"
    }

    if {[llength $cache]} {
	append contents "[join $cache \n]\n"
    }

    file mkdir [file dirname $file]
    fileutil::writeFile $file $contents
    return
}

proc ::cmdr::history::Load {} {
    CheckActive

................................................................................
    } else {
	return "Keep $limit entries"
    }
}

# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::history 0.1
return