|
Bong (Programmer) |
20 Jun 12 9:29 |
First of all, I'm pretty sure "it" doesn't work regardless of spaces in file names or not, whatever "it" is:
CODE --> e:\>tclsh
% set lstA [glob e:/tcl/*.*]
e:/tcl/ah2ab.tcl e:/tcl/bmptst.tcl e:/tcl/cdoll.tcl e:/tcl/clientTst.tcl e:/tcl/cmdScrub.tcl e:/
tcl/cnvTH.tcl e:/tcl/cnvTH2.tcl e:/tcl/fixUPL.tcl e:/tcl/fndrpl.tcl e:/tcl/HxBnProcs.tcl e:/tcl/
imgtest.tcl e:/tcl/lis1245.tcl e:/tcl/LIS2MUS.tcl e:/tcl/lstbxTst.tcl e:/tcl/mde2mus.tcl e:/tcl/
mkAEHFgrdimg.tcl e:/tcl/mkDmp2.tcl e:/tcl/mkSimDmp.tcl e:/tcl/ms2date.tcl e:/tcl/rbtest.tcl e:/t
cl/rcImg.tcl e:/tcl/rnmpix.tcl e:/tcl/scrTbl.tcl e:/tcl/serverTst.tcl e:/tcl/setMcrI.tcl e:/tcl/
setSB.tcl e:/tcl/xflds.tcl
% file mtime $lstA
could not read "e:/tcl/ah2ab.tcl e:/tcl/bmptst.tcl e:/tcl/cdoll.tcl e:/tcl/clientTst.tcl e:/tcl/
cmdScrub.tcl e:/tcl/cnvTH.tcl e:/tcl/cnvTH2.tcl e:/tcl/fixUPL.tcl e:/tcl/fndrpl.tcl e:/tcl/HxBnP
rocs.tcl e:/tcl/imgtest.tcl e:/tcl/lis1245.tcl e:/tcl/LIS2MUS.tcl e:/tcl/lstbxTst.tcl e:/tcl/mde
2mus.tcl e:/tcl/mkAEHFgrdimg.tcl e:/tcl/mkDmp2.tcl e:/tcl/mkSimDmp.tcl e:/tcl/ms2date.tcl e:/tcl
/rbtest.tcl e:/tcl/rcImg.tcl e:/tcl/rnmpix.tcl e:/tcl/scrTbl.tcl e:/tcl/serverTst.tcl e:/tcl/set
McrI.tcl e:/tcl/setSB.tcl e:/tcl/xflds.tcl": no such file or directory
%
I think I would use the -command option in lsort:
CODE --> % proc timesort {a b} {
if {[file mtime $a]<[file mtime $b]} {return -1} else {return 1}
}
% set lstB [lsort -command timesort $lstA]
e:/tcl/ms2date.tcl e:/tcl/setSB.tcl e:/tcl/setMcrI.tcl e:/tcl/cmdScrub.tcl e:/tcl/HxBnProcs.tcl
e:/tcl/ah2ab.tcl e:/tcl/mkAEHFgrdimg.tcl e:/tcl/mkSimDmp.tcl e:/tcl/mkDmp2.tcl e:/tcl/LIS2MUS.tc
l e:/tcl/lis1245.tcl e:/tcl/fixUPL.tcl e:/tcl/rcImg.tcl e:/tcl/cnvTH.tcl e:/tcl/mde2mus.tcl e:/t
cl/xflds.tcl e:/tcl/clientTst.tcl e:/tcl/serverTst.tcl e:/tcl/lstbxTst.tcl e:/tcl/cnvTH2.tcl e:/
tcl/scrTbl.tcl e:/tcl/fndrpl.tcl e:/tcl/rbtest.tcl e:/tcl/cdoll.tcl e:/tcl/rnmpix.tcl e:/tcl/bmp
tst.tcl e:/tcl/imgtest.tcl
% _________________
Bob Rashkin |
|