/* Source code made by iri This code is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. You can do what you want with it */ fun listConcatenate (listA, listB)= if listA == nil then listB else let listA -> [h nxt] in h :: listConcatenate nxt listB;; fun print (list)= if list == nil then 0 else ( _fooS hd list; print tl list );; fun listFilesInDirectory (dir)= _listoffiles dir;; fun listDirInDirectory (dir)= _listofsubdir dir;; fun listDirectories (listDir, out)= if listDir == nil then out else ( set out = listConcatenate out listFilesInDirectory hd listDir; set out = listConcatenate out listDirectories listDirInDirectory hd listDir out; listDirectories tl listDir out );; fun mainDir ()= let listFilesInDirectory "locked" -> rootFiles in let listDirInDirectory "locked" -> rootSubFolder in let listDirectories rootSubFolder rootFiles -> list in print list; 0;; /* --- */ fun checkFile (pathname)= if (nil == _checkpack pathname) then 0 else 1;; fun getContent (pathreference)= let _getpack pathreference -> content in strextr content;; fun findValue (listContent, key)= hd switchstr listContent key;; // only the first word is useful in this case fun mainGet ()= let "locked/etc/version.txt" -> pathName in let "version" -> key in if checkFile pathName then let _checkpack pathName -> refPathName in let getContent refPathName -> listWords in let findValue listWords key -> res in if res == nil then _fooS strcat key " not found" else _fooS strcatn key :: " is " :: res :: nil else _fooS "file not found"; 0;;