Change backup file functionality
Not logged in

2008/02/07 Backup in subfolder instead of folder msel: Is it possible to change the backup mode of tkoutline. Now every time the file is copied in a file named with the ending ~. Is it possible to create a backup instead in a subfolder, so that you have this structure (e.g.):


What I want

where Backup is a subfolder of the folder where file1 and file2 are stored.

2008/02/10 - Brian Theado - here's some code you can put in your startup script that should do what you want:

 proc ::tkoutline::saveBackupFile fileName {
    if {file exist $fileName} {
        set dir file join [file dirname $fileName Backup]
        file mkdir $dir
        set backup file join $dir [file tail $fileName]
        file copy -force $fileName $backup
 proc ::tkoutline::saveTreeToFile {tree fileName} {
    saveBackupFile $fileName
    set nestedList treeconvert::treeToListMultiLine $tree
    set f open $fileName w
    puts $f $nestedList
    close $f

See also Disable backup file functionality