webif/webif/html/edit/perms.jim
hummypkg a9f7ba3ff2 1.2.4
git-svn-id: file:///root/webif/svn/pkg/webif/trunk@2451 2a923420-c742-0410-a762-8d5b09965624
2015-08-14 19:33:25 +00:00

26 lines
360 B
Plaintext
Executable File

#!/mod/bin/jimsh
package require cgi
source /mod/webif/lib/setup
require pretty_size
cgi_input
#cgi_dump
set file [cgi_get file "/tmp/hosts"]
if {$file eq "-"} { exit }
httpheader "text/plain" 0
if {[cgi_get op "-"] eq "x"} {
exec chmod +x $file
}
if {![file exists $file]} {
puts 0
} else {
set stat [file stat $file]
puts $($stat(mode) & 0x1ff)
}