++fu file-utils

a door of utilities for doing lookups and transformations within a $file.


in a hawk-500 context, the current file is bound to this door with the f face.

this documentation page uses itself as an example for documentation.

so in the examples below, the f refers to the +fu engine bound the file that includes this page at its root.

the source code lives in /lib/hawk/hoon


get

unitized page at relative path

(get:f /one)
[~ [meta=[fil=~ dir=[n=[p=~..y q=[fil=~ dir=[n=[p=~.case q=[fil=[~ [p=~.da q=170.141.184.507.152.171.603.267.164.222.764.613.632]] dir=~]] l=~ r=~]]] l=~ r=[n=[p=~.name q=[fil=[~ [p=~.tas q=54.015.209.988.432]] dir=~]] l={} r={}]]] code=[p=/text/hawk-500 q=[p=6 q=54.014.485.030.971]] data=[g=[n=%h1 a=~] c=~[[g=[n=%$ a=~[[n=%$ v="1"]]] c=~]]]]]
(get:f /blah)
~

git

page at relative path or bunted page

(git:f /one)
[meta=[fil=~ dir=[n=[p=~..y q=[fil=~ dir=[n=[p=~.case q=[fil=[~ [p=~.da q=170.141.184.507.152.171.603.267.164.222.764.613.632]] dir=~]] l=~ r=~]]] l=~ r=[n=[p=~.name q=[fil=[~ [p=~.tas q=54.015.209.988.432]] dir=~]] l={} r={}]]] code=[p=/text/hawk-500 q=[p=6 q=54.014.485.030.971]] data=[g=[n=%h1 a=~] c=~[[g=[n=%$ a=~[[n=%$ v="1"]]] c=~]]]]
(git:f /blah)
[meta=[fil=~ dir=~] code=[p=/ q=[p=0 q=0]] data=[g=[n=%$ a=~] c=~]]

got

page at relative path or crash

(got:f /one)
[meta=[fil=~ dir=[n=[p=~..y q=[fil=~ dir=[n=[p=~.case q=[fil=[~ [p=~.da q=170.141.184.507.152.171.603.267.164.222.764.613.632]] dir=~]] l=~ r=~]]] l=~ r=[n=[p=~.name q=[fil=[~ [p=~.tas q=54.015.209.988.432]] dir=~]] l={} r={}]]] code=[p=/text/hawk-500 q=[p=6 q=54.014.485.030.971]] data=[g=[n=%h1 a=~] c=~[[g=[n=%$ a=~[[n=%$ v="1"]]] c=~]]]]
(got:f /blah)
crash

gut

page at path or fallback

(gut:f /blah [*info [/text/plain (as-octs:mimes:html 'fallback file')] *manx])
[meta=[fil=~ dir=~] code=[p=/text/plain q=[p=13 q=8.035.596.214.491.878.099.156.183.310.694]] data=[g=[n=%$ a=~] c=~]]

has

boolean lookup

(has:f /one)
%.y
(has:f /blah)
%.n

tip

page at / or bunted page

tip:f
the $page you are currently reading

met

meta.page at /

met:f
[fil=~ dir=[n=[p=~..y q=[fil=~ dir=[n=[p=~.case q=[fil=[~ [p=~.da q=170.141.184.507.152.171.603.267.164.222.764.613.632]] dir=~]] l=~ r=~]]] l=~ r=[n=[p=~.subtitle q=[fil=[~ [p=~.t q=7.693.867]] dir=~]] l={} r={}]]]

mim

code.page at /

mim:f
[/text/hawk-500 [... octs of current page ...]]

cod

code.page as @t at /

cod:f
hawk-500 cord of current page

dat

data.page at /

dat:f
the manx of the current page

wap

flattened list of sub-paths & sub-pages (without root)

wap:f
[i=[p=/two q=[meta=[fil=~ dir=[n=[p=~..y q=[fil=~ dir=[n=[p=~.case q=[fil=[~ [p=~.da q=170.141.184.507.152.171.603.267.164.222.764.613.632]] dir=~]] l=~ r=~]]] l=~ r=[n=[p=~.name q=[fil=[~ [p=~.tas q=55.114.721.616.240]] dir=~]] l={} r={}]]] code=[p=/text/hawk-500 q=[p=14 q=2.260.811.556.770.164.427.484.563.075.851.323]] data=[g=[n=%div a=~] c=~[[g=[n=%$ a=~[[n=%$ v="page two"]]] c=~]]]]] t=[i=[p=/one q=[meta=[fil=~ dir=[n=[p=~..y q=[fil=~ dir=[n=[p=~.case q=[fil=[~ [p=~.da q=170.141.184.507.152.171.603.267.164.222.764.613.632]] dir=~]] l=~ r=~]]] l=~ r=[n=[p=~.name q=[fil=[~ [p=~.tas q=54.015.209.988.432]] dir=~]] l={} r={}]]] code=[p=/text/hawk-500 q=[p=6 q=54.014.485.030.971]] data=[g=[n=%h1 a=~] c=~[[g=[n=%$ a=~[[n=%$ v="1"]]] c=~]]]]] t=~]]

wah

list of sub-paths

wah:f
~[/two /one]

wax

list of sub-pages

wax:f
~[[meta=[fil=~ dir=[n=[p=~..y q=[fil=~ dir=[n=[p=~.case q=[fil=[~ [p=~.da q=170.141.184.507.152.171.603.267.164.222.764.613.632]] dir=~]] l=~ r=~]]] l=~ r=[n=[p=~.name q=[fil=[~ [p=~.tas q=55.114.721.616.240]] dir=~]] l={} r={}]]] code=[p=/text/hawk-500 q=[p=14 q=2.260.811.556.770.164.427.484.563.075.851.323]] data=[g=[n=%div a=~] c=~[[g=[n=%$ a=~[[n=%$ v="page two"]]] c=~]]]] [meta=[fil=~ dir=[n=[p=~..y q=[fil=~ dir=[n=[p=~.case q=[fil=[~ [p=~.da q=170.141.184.507.152.171.603.267.164.222.764.613.632]] dir=~]] l=~ r=~]]] l=~ r=[n=[p=~.name q=[fil=[~ [p=~.tas q=54.015.209.988.432]] dir=~]] l={} r={}]]] code=[p=/text/hawk-500 q=[p=6 q=54.014.485.030.971]] data=[g=[n=%h1 a=~] c=~[[g=[n=%$ a=~[[n=%$ v="1"]]] c=~]]]]]