] map ;
: load-ldconfig-cache ( -- seq )
- "/sbin/ldconfig -r" utf8 [ read-lines ] with-process-reader
+ "/sbin/ldconfig -r" process-lines
rest parse-ldconfig-lines ;
: name-matches? ( lib double -- ? )
: process-lines ( desc -- lines )
utf8 <process-reader> stream-lines ;
+: process-contents ( desc -- contents )
+ utf8 <process-reader> stream-contents ;
+
<PRIVATE
: (process-writer) ( desc encoding -- stream process )
console-vm-path "-script" "stderr.factor" 3array >>command
[ "err2" ".txt" unique-file ] with-temp-directory
[ err-path set-global ] keep >>stderr
- process-lines first
+ process-contents
] with-directory
] unit-test
: changelog ( -- authors )
image-path parent-directory [
- "git log --no-merges --pretty=format:%an"
- utf8 [ read-lines ] with-process-reader
+ "git log --no-merges --pretty=format:%an" process-lines
] with-directory ;
: merge-aliases ( authors -- authors' )
"--pretty=format:%h %an: %s" ,
".." glue ,
] { } make
- utf8 [ read-lines ] with-process-reader ;
+ process-lines ;
: updates ( from to -- lines )
git-log reverse
IN: mason.git
: git-id ( -- id )
- { "git" "show" } utf8 [ read-lines ] with-process-reader
+ { "git" "show" } process-lines
first split-words second ;
<PRIVATE
{ "git" "status" "--porcelain" } ;
: git-status ( -- seq )
- git-status-cmd utf8 [ read-lines ] with-process-reader ;
+ git-status-cmd process-lines ;
: check-repository ( -- seq )
"factor" [ git-status ] with-directory ;
: attr|| ( attr1 attr2 -- string )
" || " glue ;
-<PRIVATE
-
-: run-process-output ( command -- seq )
- utf8 [ read-lines ] with-process-reader ;
-
-PRIVATE>
-
: mdfind ( query -- results )
- "mdfind -onlyin . %s" sprintf run-process-output ;
+ "mdfind -onlyin . %s" sprintf process-lines ;
: mdfind. ( query -- )
mdfind [ dup <pathname> write-object nl ] each ;
: mdls ( path -- )
- absolute-path "mdls" swap 2array run-process-output
+ absolute-path "mdls" swap 2array process-lines
[ print ] each ;
: mdutil ( flags on|off volume -- seq )
[ "mdfind" swap "-" prepend "-i" ] 2dip 5 narray
- run-process-output ;
+ process-lines ;
: mdimport ( path -- seq )
- absolute-path "mdimport " prepend run-process-output ;
+ absolute-path "mdimport " prepend process-lines ;
: mdimport-with ( path options -- seq )
- swap absolute-path "mdimport %s %s" sprintf run-process-output ;
+ swap absolute-path "mdimport %s %s" sprintf process-lines ;
MEMO: kMDItems ( -- seq )
- "mdimport -A" run-process-output
+ "mdimport -A" process-lines
[ "'kMDItem" head? ] filter
[ "\t" split harvest [ but-last rest ] map ] map ;