As I have seen on the TCL manual (http://tcl.activestate.com/man/tcl8.2.3/TclCmd/file.htm) I have found the "file size name" to get the size of a file and "file mtime name" for the last modified thing. Will this two work also for the dirs or only for files?
Also I have found some other nice things I can do with the file thing and I haven't thinked about using them on the web page generation. Neat..
Once the game is over, the king and the pawn go back in the same box.
proc task:tmp { hand idx arg } {
global db
set file "pub/"
putlog "Size: [file size $file]"
}
the size works only for files. Seems that I have to get the size of all the files and then to add them to a variable and finaly that variable represends the size of the dir. Is there any other way to seee the dir's size? My alternative is bit messy but what a hell.. If there is no other I must do so.. Ce la vie..
As for the "file mtime name" I have noticed that works for a dir. The only thing that I'm confused with is that I'm getting a result like this: 1042649520. How to make it look like eg. January 17, 2003?
Once the game is over, the king and the pawn go back in the same box.
proc filefullsize {dir} {
if {![file exists $dir]} { error "No such directory exists" }
set c 0
foreach a [glob -type f $dir] {
incr c [file size $a]
}
return $c
}
"/files/" is a obsolute directory.
"files/" is relative to the current directory
"files" is also relative to the currect die. It simply doesn't have the trailing slash.
Now works. As as sow, the result is in bytes, how to transfor it in KB and/or MB?
Oh, and also how to transform the result of the [file atime "${dir}"] in something more comestible like 17 Jan. 2003 @ 12:45 or something like this. I'm getting an result in seconds or something like this as far as I can see..
Once the game is over, the king and the pawn go back in the same box.