add decrypted file touch

git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1713 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg
2013-10-29 20:51:10 +00:00
parent d801e71bf3
commit e2c099668e
3 changed files with 21 additions and 2 deletions

View File

@@ -290,7 +290,7 @@ proc do_decrypt {ts} {
dsc $size
runplugin predecrypt $ts
set flagfile "$tmp/decrypting.$bfile"
exec /mod/bin/busybox/touch $flagfile
file touch $flagfile
startclock
log " DECRYPT: $rfile" 0
log " DLNA: $url" 0
@@ -331,6 +331,8 @@ proc do_decrypt {ts} {
file rename $file "$rfile.encrypted"
# Move the decrypted copy into place.
file rename "$tmp/$bfile" $file
# Set the file time to match the old file
file touch $file "$rfile.encrypted"
# Patch the HMT - quickest way to get back to a playable file.
exec /mod/bin/hmt -encrypted "$rfile.hmt"

View File

@@ -39,10 +39,27 @@ proc {file rename} {{force {}} source target} {
}
}
proc {file touch} {target {ref ""}} {
try {
if {$ref ne ""} {
if {![file exists $ref]} {
error "ref file does not exist."
}
exec /mod/bin/busybox/touch -r $ref $target
} else {
exec /mod/bin/busybox/touch $target
}
} on error {msg opts} {
incr opts(-level)
return {*}$opts $msg
}
}
local proc file {cmd args} {
switch $cmd {
"rename" { tailcall {file rename} {*}$args }
"copy" { tailcall {file copy} {*}$args }
"touch" { tailcall {file touch} {*}$args }
default { tailcall upcall file $cmd {*}$args }
}
}