Tcl
|
This Tcl script provides a procedure for returning
the contents of a target directory by name and size.
The full path name and the size, in bytes, of each
item in a target directory are appended to a list
supplied by the user. |
The input parameters are: listsizes dir the full path of the directory to be listed Example: To list the sizes of the sub-directories and files in a directory the listsizes procedure might be used by another Tcl script as follows. source /Users/Documents/TCL/listsizes.tcl # print the directory listing to the console set files [listsizes /Users/Documents] puts "$files" The output would look (something) like this, 884 /WebSite 306 /wip_fall2002 272 /wip_fall2002_October 6277120 3Delight.pkg.tar 17407813 Acrobat Reader Installer etc... Note the use of the source command to "point" the Tcl interpreter at the directory containing the listsizes.tcl script. |
© 2002- Malcolm Kesson. All rights reserved.