2015-10-09 01:22:34 +03:00
|
|
|
:: File writer
|
|
|
|
::
|
|
|
|
:::: /hoon/write/app
|
|
|
|
::
|
|
|
|
|_ [bowl ~]
|
|
|
|
++ beak-now byk(r [%da now])
|
|
|
|
++ poke-json
|
|
|
|
|= jon=json
|
|
|
|
=- (poke--data (need (- jon.+)))
|
|
|
|
=> jo
|
|
|
|
%- ot :~
|
|
|
|
pax/(cu deft (su fel:stab))
|
|
|
|
dat/(of json/some mime/(pe / (cu taco so)) ~) :: XX mite
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ poke-write-paste
|
|
|
|
|= [typ=?(%hoon %md %txt) txt=@t]
|
|
|
|
(poke--data [`typ /pub/paste/(scot %da now)] %mime / (taco txt))
|
|
|
|
::
|
|
|
|
++ poke--data
|
|
|
|
|= [[ext=(unit ,@t) pax=path] dat=$%([%json json] [%mime mime])]
|
|
|
|
?~ ext $(ext [~ -.dat])
|
|
|
|
=+ cay=?-(-.dat %json [-.dat !>(+.dat)], %mime [-.dat !>(+.dat)])
|
|
|
|
?: =(u.ext -.dat) (made pax ~ `cay)
|
|
|
|
[[ost %exec pax our ~ beak-now %cast u.ext `cay]~ +>.$] :: XX defer %nice
|
|
|
|
::
|
|
|
|
++ made
|
|
|
|
|= [pax=wire @ res=gage]
|
2015-10-27 22:18:51 +03:00
|
|
|
?. =(our src)
|
|
|
|
~|(foreign-write/[our=our src=src] !!)
|
2015-10-09 01:22:34 +03:00
|
|
|
?+ -.res ~|(gage/-.res !!)
|
|
|
|
%| (mean p.res)
|
|
|
|
%& =- [[ost %info / our -]~ +>.$]
|
|
|
|
(foal :(welp (tope beak-now ~) pax /[-.p.res]) p.res)
|
|
|
|
==
|
|
|
|
--
|