forked from hummypkg/webif
foreign characters
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1786 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
@@ -308,9 +308,9 @@ proc s_time {a b} {
|
||||
}
|
||||
|
||||
if {[catch {file stat $a l}]} { return 0}
|
||||
set at $l(ctime)
|
||||
set at $l(mtime)
|
||||
if {[catch {file stat $b l}]} { return 0}
|
||||
set bt $l(ctime)
|
||||
set bt $l(mtime)
|
||||
|
||||
if {$at < $bt} { return -1 }
|
||||
if {$at > $bt} { return 1 }
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
if {![exists -proc class]} { package require oo }
|
||||
if {![exists -proc sqlite3.open]} { package require sqlite3 }
|
||||
if {![exists -proc binary]} { package require binary }
|
||||
|
||||
class system {}
|
||||
|
||||
@@ -179,6 +180,15 @@ proc {system busy} {} {
|
||||
proc {system inuse} {file} {
|
||||
# Is anything using the file?
|
||||
set file [file rootname [file tail $file]]
|
||||
|
||||
# Escape any unicode characters to match lsof output.
|
||||
foreach range [lreverse [\
|
||||
regexp -inline -indices -all -- {[\x80-\xff]} $file]] {
|
||||
set i [lindex $range 0]
|
||||
binary scan [string index $file $i] H2 hex
|
||||
set file [string replace $file $i $i "\\x$hex"]
|
||||
}
|
||||
|
||||
set c 0
|
||||
foreach line [split [exec /mod/bin/lsof] "\n"] {
|
||||
if {[string first $file $line] >= 0} { incr c }
|
||||
|
||||
Reference in New Issue
Block a user