On Tue, 17 Oct 2017, Sven Schreiber wrote:
Am 16.10.2017 um 16:14 schrieb Schaff, Frederik:
> Hello,
>
> Is there a way within hansl to “scan” a given folder and give back the
> subfolder names, e.g. as strings? Non-recursive would be enough.
Spontaneously I'd say this is not possible "within" hansl. However, with
embedded shell commands (look for '!' and 'shell') it would "of
course" be
feasible. You can also use python or similar programs instead of a shell in a
narrow sense.
Very nice idea. If you have Python installed, you may find this useful:
<hansl>
function strings subdirs(string path)
outfile s --buffer --quiet
foreign language=python
from os import walk
a = next(walk("@path"))[1]
for d in a:
print(d)
end foreign
outfile --close
l = ""
strings ret = null
loop while getline(s, l) --quiet
ret += l
endloop
return ret
end function
path = "@dotdir"
a = subdirs(path)
print a
</hansl>
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------