simple 'binfmtload' script in python

jam jam at newimage.com
Wed Jun 23 00:17:26 EDT 1999


greetings,

in an effort to move forward with another project I've been working on, I
wrote up a simple script that tells a linux 2.2.x kernel how to execute a
java binary. 

I based this script on information in /usr/src/linux/Documentation/java.txt
and experimentation.

it seems to work for me. I'd like to know if anyone else finds it useful, or
has ideas on how it can be improved. it's terribly simple, but it get's the
job done.

regards,
J
-- 
|| visit gfd <http://quark.newimage.com/> 
|| psa member #293 <http://www.python.org/> 
|| New Image Systems & Services, Inc. <http://www.newimage.com/>
-------------- next part --------------
#!/usr/bin/env python

fp = open("/proc/sys/fs/binfmt_misc/register", "w+b")
fp.write(":Java:M::\xca\xfe\xba\xbe::/usr/local/java/jdk1.2/bin/java:\n")
fp.close()
fp = open("/proc/sys/fs/binfmt_misc/register", "w+b")
fp.write(":Applet:M::<!--applet::/usr/local/java/jdk1.2/bin/appletviewer:\n")
fp.close()


More information about the Python-list mailing list