urbit/gen/ls/subdir.hoon

26 lines
553 B
Plaintext
Raw Normal View History

2016-10-22 02:44:39 +03:00
:: Filesystem iterator XX move to lib/
2016-02-05 05:57:44 +03:00
::
2016-02-05 06:05:37 +03:00
:::: /hoon/subdir/ls/gen
2016-02-05 05:57:44 +03:00
::
/? 310
2015-05-28 05:46:58 +03:00
|%
++ subdir
|= {vane/?($c $g) pax/path des/(map @t $~)}
2015-05-28 05:46:58 +03:00
^- tank
:+ %rose [" " `~]
%+ turn (sort ~(tap by des) aor)
|= {kid/@ta $~}
2015-05-28 05:46:58 +03:00
=+ paf=`path`/[kid]
=- :+ %rose ["/" ~ ?:(dir "/" ~)]
2016-02-12 00:53:14 +03:00
(turn paf |=(a/knot leaf+(trip a)))
|- ^- {dir/? paf/path}
=+ arf=.^(arch (cat 3 vane %y) (weld pax paf))
?^ fil.arf
2015-05-28 05:46:58 +03:00
[| paf]
2015-09-08 23:15:40 +03:00
?~ dir.arf
2015-05-28 05:46:58 +03:00
[& paf] :: !!
2016-02-12 00:53:14 +03:00
?. ?=({^ $~ $~} dir.arf)
2015-05-28 05:46:58 +03:00
[& paf]
2015-09-08 23:15:40 +03:00
$(paf (welp paf /[p.n.dir.arf]))
2015-05-28 05:46:58 +03:00
--