TYL PROGRAMMING LANGUAGE
▶ MANAGE FILE SYSTEM
Tyl has an extensive file system module that can be used to operate on the file system.

This is a demonstration of searching for file names that contain a string in a root directory 'C:\temp\rootdir\', and its subsequent directories:
dir rootdir 'C:\temp\rootdir\'
sch '1'
dlist [ rootdir ]
schlist [ ]
dctr lastdctr -1
~
lastdctr < 0 ?
  ds io.directories dir
  dctr 1
  lastdctr len ds
  ds d ~ dlist d
  
  diff lastdctr - dctr + 1
  diff <= 0 ?
  i diff ~
   ds io.directories dlist dctr
   ds d ~ dlist d
   dctr ++
   lastdctr ++ len ds
  
inf { name '' parentpath '' }
dlist d ~
files io.files d
files f ~
  inf io.info f
  ind string.index inf.name sch
  ind >= 0 ?
   idctr ++
   schlist { name inf.name pdir inf.parentpath }
  
fmap { name '' pdir '' }
max len schlist
print 'searching for `' + sch + '` in `' + rootdir + '`'
print 'found ' + max + ' results' + newline
i max ~
fmap schlist i
print fmap.name + ': ' + fmap.pdir
searching for '1' in 'C:\temp\rootdir\'
found 4 results

a1: C:\temp\rootdir\dira\
b1: C:\temp\rootdir\dirb\
b1: C:\temp\rootdir\dira\diraa\
b1: C:\temp\rootdir\dira\dirab\
All file system functionality can be found in IO Module Reference.