In q/k, how does one determine a complete filesystem tree for a drive,stored as a table with fields corresponding with the depth of eachbranch of the tree? In addition other file info i.e size, date, type,etc. would be great, the more the better.
you could generate a list of all the files (including the structure)
q){$[-11=type f:key x;f;(` sv x,`),.z.s each` sv’x,/:f]}`:q
`:q/
`:q/.DS_Store
`:q/dscripts/`:q/dscripts/error_raised.d`:q/dscripts/error_rollback.d`:q/dscr..
`:q/ide/`:q/ide/README.txt
(`:q/interfaces/;(`:q/interfaces/csharp/;`:q/interfaces/csharp/Documentation…
`:q/k4.lic
`:q/m64/`:q/m64/q
(`:q/mac/;`:q/mac/qcmds.txt;`:q/mac/qcon;`:q/mac/rlwrap/`:q/mac/rlwrap/libncu..
`:q/q.k
`:q/qvars.sh
`:q/s.k
`:q/sp.q
`:q/sp.s
`:q/trade.q
or you can leave out the directory-names
q){$[-11=type f:key x;f;.z.s each sv'x,/:f]}
:q
:q/.DS\_Store
:q/dscripts/error_raised.d:q/dscripts/error\_rollback.d
:q/dscripts/http.d:.. ,
:q/ide/README.txt
((:q/interfaces/csharp/Documentation.chm;(
:q/interfaces/csharp/Example/Exam..
:q/k4.lic ,
:q/m64/q
(:q/mac/qcmds.txt;
:q/mac/qcon;:q/mac/rlwrap/libncurses.5.dylib
:q/mac/rlwr..
:q/q.k
:q/qvars.sh
:q/s.k
:q/sp.q
:q/sp.s
:q/trade.q
finally flattening it:
q)show s:raze over {$[-11=type f:key x;f;.z.s each sv'x,/:f]}
:q
:q/.DS_Store
:q/dscripts/error_raised.d:q/dscripts/error_rollback.d
:q/dscr..
then
q)hcount each s
and so on
Regards,
Attila
On Tue, Jul 22, 2008 at 5:49 PM, k.os.tao <k.os.tao> wrote:
>
> In q/k, how does one determine a complete filesystem tree for a drive,
> stored as a table with fields corresponding with the depth of each
> branch of the tree? In addition other file info i.e size, date, type,
> etc. would be great, the more the better.
> >
>
</k.os.tao>