relpipe-data/examples.xml
branchv_0
changeset 240 d81c623de788
parent 238 6383a4457833
child 241 f71d300205b7
equal deleted inserted replaced
239:627ff99d475b 240:d81c623de788
   701 		
   701 		
   702 		<p>
   702 		<p>
   703 			Our filesystems contain valuable information and using proper tools we can extract them.
   703 			Our filesystems contain valuable information and using proper tools we can extract them.
   704 			Using <code>relpipe-in-filesystem</code> we can gather metadata of our files and process them in relational way.
   704 			Using <code>relpipe-in-filesystem</code> we can gather metadata of our files and process them in relational way.
   705 			This tools does not traverse our filesystem (remember the rule: <em>do one thing and do it well</em>),
   705 			This tools does not traverse our filesystem (remember the rule: <em>do one thing and do it well</em>),
   706 			instead, it eats list of file paths separated from standard input.
   706 			instead, it eats a list of file paths separated by <code>\0</code>.
   707 			It is typically used together with the <code>find</code> command, but we can also create such list by hand using e.g. <code>printf</code> command.
   707 			It is typically used together with the <code>find</code> command, but we can also create such list by hand using e.g. <code>printf</code> command or <code>tr \\n \\0</code>.
   708 		</p>
   708 		</p>
   709 		
   709 		
   710 		<m:pre jazyk="bash">find /etc/ssh/ -print0 | relpipe-in-filesystem | relpipe-out-tabular</m:pre>
   710 		<m:pre jazyk="bash">find /etc/ssh/ -print0 | relpipe-in-filesystem | relpipe-out-tabular</m:pre>
   711 		
   711 		
   712 		<p>
   712 		<p>
   819 find -type f -printf '%P\0' \
   819 find -type f -printf '%P\0' \
   820 	| relpipe-in-filesystem --file path --file size --xattr user.xdg.origin.url  \
   820 	| relpipe-in-filesystem --file path --file size --xattr user.xdg.origin.url  \
   821 	| relpipe-out-tabular
   821 	| relpipe-out-tabular
   822 ]]></m:pre>
   822 ]]></m:pre>
   823 
   823 
   824 		<p>And now we know, where the files on our disk come from:</p>
   824 		<p>And now we know, where the files on our disk came from:</p>
   825 
   825 
   826 		<pre><![CDATA[filesystem:
   826 		<pre><![CDATA[filesystem:
   827  ╭───────────────────────────┬────────────────┬────────────────────────────────────────────────────────────────────╮
   827  ╭───────────────────────────┬────────────────┬────────────────────────────────────────────────────────────────────╮
   828  │ path             (string) │ size (integer) │ user.xdg.origin.url                                       (string) │
   828  │ path             (string) │ size (integer) │ user.xdg.origin.url                                       (string) │
   829  ├───────────────────────────┼────────────────┼────────────────────────────────────────────────────────────────────┤
   829  ├───────────────────────────┼────────────────┼────────────────────────────────────────────────────────────────────┤