Posted to tcl by saedelaere at Sun Dec 06 21:59:58 GMT 2009view raw
- proc timeshift_calcDF {cancel} {
- if {"$cancel" == "cancel"} {
- puts $::main(debug_msg) "\033\[0;1;33mDebug: timeshift_calcDF \033\[0;1;31m::cancel:: \033\[0m"
- catch {after cancel $::timeshif(df_id)}
- unset -nocomplain ::timeshif(df_id)
- return
- }
- catch {exec df "$::option(timeshift_path)/"} df_values
- foreach line [split $df_values "\n"] {
- if {[string is digit [lindex $line 3]]} {
- set remaining_space [expr int([lindex $line 3].0 / 1024)]
- if {$remaining_space <= $::option(timeshift_df)} {
- log_writeOutTv 2 "Remaining space <= $::option(timeshift_df)\MB will stop timeshift."
- timeshift .top_buttons.button_timeshift
- return
- }
- }
- }
- after 1000 [list timeshift_calcDF 0]
- }
-