Article View: comp.sys.next.sysadmin
Article #1990Script to print out app/suffix mappings
From: Christopher Lane
Date: Wed, 23 Dec 1992 22:38
Date: Wed, 23 Dec 1992 22:38
74 lines
2581 bytes
2581 bytes
In article <12261@cayman.COM> writes:
> Where is the mapping between a given filename suffix and the app that is
> launched with the icon is clicked in the File Browser?
Although the answer to this is clearly to use the Inspector tool as Robert
Frank <frank@ifi.unibas.ch> replied earlier, for those interested in knowing
the actual set of application to suffix mappings currently in effect, the
following 'csh' script will dump them (after a fashion) to stdout in the form:
ais ImageViewer
anim Icon
anim Movie
BackModule BackSpace
BackO BackSpace
bbx Improv
bcvt GraphicsWorkshop
book FrameMaker
Brush ImageViewer
bshlf Librarian
....
To use it, save it to a file (e.g. called 'mappings') and then just invoke it
with no arguments to get the current set of mappings based on Workspace's
ApplicationPaths default or pass in selected applications (e.g. /NextDemos/*).
- Christopher
#!/bin/csh -f
# Print a listing of application to extension mappings to stdout
# C.D.lane (lane@sumex-aim.stanford.edu) 12/23/92
#
# Copyright: 1992 by The Leland Stanford Junior University. This
# program may be distributed without restriction for non-commercial use.
set program = $0
set temp = "/tmp/${program:t}.${user}.$$.T"
set data = "/tmp/${program:t}.${user}.$$.D"
unset program
set owner = Workspace; set default = ApplicationPaths
onintr exit
if ( $#argv > 0 ) then
set files = `glob ${argv:q}`
else
set files = ''
foreach file (`dread $owner $default | awk '{print $3}' | tr ':' ' '`)
set files = `glob ${files:q} $file/*`
end
endif
while ( $#files > 0 )
set file = $files[1]
if ( ${file:e} == "app" ) then
set tail = ${file:t}
set file = ${file}/${tail:r}
endif
size -m $file |& grep __ICON >> /dev/null
if ( $status == 0) then
segedit $file -extract __ICON __header $temp
grep -e '^S' < $temp | awk '{print $2 " " $3}' >> $data
endif
shift files
end
sort -uf < $data
exit:
rm -rf $temp $data
Technical Details
Message-ID:
<1haponINN4oo@morrow.stanford.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!morrow.stanford.edu!morrow.stanford.edu!usenetReferences:
<1992Dec23.081421.27143@urz.unibas.ch>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!morrow.stanford.edu!morrow.stanford.edu!usenet From: lane@sumex-aim.stanford.edu (Christopher Lane) Newsgroups: comp.sys.next.sysadmin Subject: Script to print out app/suffix mappings Date: 23 Dec 1992 22:38:15 GMT Organization: Stanford University Lines: 74 Distribution: usa Message-ID: <1haponINN4oo@morrow.stanford.edu> References: <1992Dec23.081421.27143@urz.unibas.ch> Reply-To: lane@sumex-aim.stanford.edu (Christopher Lane) NNTP-Posting-Host: ssrg-next-1.stanford.edu