Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Directory check

 [1/2] from: arolls:bigpond:au at: 17-Jul-2001 2:59


> insert tail result to-string singledir
append result to-string copy/part singledir back tail singledir

 [2/2] from: mario:cassani:icl at: 16-Jul-2001 16:52


Hallo, I'm trying to count the files into the subdirectories of a given path in order to save numbered files into each dir. To collect the info I use the following funxtion: 8<----------8<----------8<----------8<----------8<---------- dirs-numfiles?: func [dirname [file!]] [ result: clear [] dirslist: read dirize dirname foreach singledir dirslist [ if dir? dirname/:singledir [ insert tail result singledir insert tail result length? read dirname/:singledir/. ] ] copy result ] 8<----------8<----------8<----------8<----------8<---------- With EMPTY: C:/Test/A C:/Test/B C:/Test/C C:/Test/D I obtain:
>> dir-numfiles? %/C/Test/
== [%A/ 0 %B/ 0 %C/ 0 %D/ 0] while I want a result such as: == [A 0 B 0 C 0 D 0] to:
>> find dir-numfiles? %/C/Test/ "B"
== [B 0 C 0 D 0] I've tried to make this change without any difference: insert tail result to-string singledir Any ideas, please? Thankyou and best regards Mario