|
|
|
|
@ -82,12 +82,16 @@ namespace eval punkcheck {
|
|
|
|
|
return $record_list |
|
|
|
|
} |
|
|
|
|
proc save_records_to_file {recordlist punkcheck_file {trigger {}}} { |
|
|
|
|
if {$trigger ne ""} { |
|
|
|
|
puts stderr "\x1b\[36mSaving [llength $recordlist] records to file '$punkcheck_file' trigger: \x1b\[32m$trigger\x1b\[m" |
|
|
|
|
} |
|
|
|
|
set newtdl [punk::tdl::prettyprint $recordlist] |
|
|
|
|
set linecount [llength [split $newtdl \n]] |
|
|
|
|
|
|
|
|
|
if {$trigger ne ""} { |
|
|
|
|
puts stderr "\x1b\[36mSaving [llength $recordlist] records as $linecount lines to file '$punkcheck_file' trigger: \x1b\[32m$trigger\x1b\[m" |
|
|
|
|
} |
|
|
|
|
#puts stdout $newtdl |
|
|
|
|
if {[file exists $punkcheck_file] && [file type $punkcheck_file] eq "file"} { |
|
|
|
|
file delete $punkcheck_file |
|
|
|
|
} |
|
|
|
|
set fd [open $punkcheck_file w] |
|
|
|
|
chan configure $fd -translation binary |
|
|
|
|
puts -nonewline $fd $newtdl |
|
|
|
|
|