|
|
Finder Table of Contents
|
|
|
|
Junior Member
Join Date: Nov 2002
Location: London
Status:
Offline
|
|
I have just sent a CD of data to someone that contains many folders and sub-folders. I also allow remote users to view this data remotely as a Workgroup on our server. I am continuously updating and adding to this data.
Is there any software utility that can create a Table of Contents, so that a user can see in one glance what is there, without having to dig around?
Thanks
|
"most people are fools, most authority is malignant, god does not exist and everything is wrong" - Ted Nelson
|
|
|
|
|
|
|
|
Grizzled Veteran
Join Date: Mar 2004
Status:
Offline
|
|
Get TextWrangler (or BBEdit Lite) and drag the folder (or disk) into an empty text window.
[might need to edit out hidden files & folders that aren't intended for user consumption.]
|
-HI-
|
|
|
|
|
|
|
|
Posting Junkie
Join Date: Oct 2005
Location: Houston, TX
Status:
Offline
|
|
ls will do what you want.
|
|
|
|
|
|
|
|
|
Grizzled Veteran
Join Date: Mar 2004
Status:
Offline
|
|
Originally Posted by mduell
ls will do what you want.
So will mtree
But neither will be as easy to read (i.e., *look* like a TOC) as much as
the results from those BareBones apps (which indent folder sublevels).
[actually, mtree -i does indent... but it's not as pretty.]
|
-HI-
|
|
|
|
|
|
|
|
Junior Member
Join Date: Nov 2002
Location: London
Status:
Offline
|
|
Thanks - I ended up with TextWrangler which did the job fine. The result has a fairly industrial look to it, but it does the job.
|
"most people are fools, most authority is malignant, god does not exist and everything is wrong" - Ted Nelson
|
|
|
|
|
|
|
|
Grizzled Veteran
Join Date: Mar 2004
Status:
Offline
|
|
I got interested enough in having something like this easily available in Terminal
that I whipped up a small shell script to filter out some of the heavy-duty extras
in mtree's (power-packed) output. Applying a few filters with sed and awk have
made it fairly usable. (save as a file, do chmod a+x, and customize to your taste):
#!/bin/bash
IFS=$' \t\n'
PATH=/bin:/usr/bin
export PATH
folder=${1:-${PWD}}; [[ -d $folder ]] || exit 1
/usr/sbin/mtree -nice -k '' -p "$folder" |
sed 's:^/set::;s: *type=[^ ]*::g;s:\\040: :g;s:^ *..$::' |
awk 'NF != 0 { print }' |awk '$0 !~ /.DS_Store/ { print }'
exit $?
Example (as run on Leopard) with script named "ltr":
Code:
ltr /Library/Perl
.
5.8.8
AppendToPath
darwin-thread-multi-2level \
SNMP.pm
Bundle
Makefile.subs.pl
NetSNMP
ASN.pm
OID.pm
TrapReceiver.pm
agent.pm
default_store.pm
agent
Support.pm
default_store.pm
netsnmp_request_infoPtr.pm
auto
Bundle
NetSNMP
.packlist
NetSNMP
ASN
ASN.bs
ASN.bundle
autosplit.ix
OID
OID.bs
OID.bundle
autosplit.ix
TrapReceiver
TrapReceiver.bs
TrapReceiver.bundle
autosplit.ix
agent
agent.bs
agent.bundle
autosplit.ix
default_store
autosplit.ix
default_store.bs
default_store.bundle
default_store
autosplit.ix
default_store.bs
default_store.bundle
SNMP
SNMP.bs
SNMP.bundle
autosplit.ix
Still has some junk in the output (mostly trailing spaces).
|
-HI-
|
|
|
|
|
|
|
|
Grizzled Veteran
Join Date: Mar 2004
Status:
Offline
|
|
Originally Posted by Hal Itosis
sed 's:^/set::;s: *type=[^ ]*::g;s:\\040: :g;s:^ *..$::' |
Slight error in line 7 there. Technically, it should be:
sed 's:^/set::;s: *type=[^ ]*::g;s:\\040: :g;s:^ *\.\.$::' |
(it worked as written nonetheless, due to the way mtree adds trailing spaces to certain items).
Heck with it, here's a version that strips the trailing spaces (and might be easier to read):
Code:
#!/bin/bash
IFS=$' \t\n'
PATH=/usr/bin
export PATH
folder=${1:-${PWD}}; [[ -d $folder ]] || exit 1
/usr/sbin/mtree -nice -k '' -p "$folder" |
sed 's:^/set::
s: *type=[^ ]*::
s:^ *\.\.$::
s: *$::
s:\\040: :g
/^$/d
/.DS_Store/d'
exit $?
(
Last edited by Hal Itosis; Nov 15, 2008 at 10:53 PM.
Reason: simplify by eliminating awk)
|
-HI-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|