Removing magic numbers
Alan Jackson
ajackson
Mon May 17 12:02:18 PDT 2004
My son has a friend who ftp'd a bunch of perl scripts from Windoze
to a Linux box for CGI stuff. Windows stupidly (or purposely?) screwed
up the magic number in the files so that they are not recognized
as perl scripts and won't run.
He figured out how to use hexedit to get rid of the magic number and fix
the problem, but now we're wondering about a better solution - a way to
script it and clean up the files automagically. We could write a little
C program, but surely there is another way out there somewhere?
All we need is a way to delete the first 3 bytes from a binary file.
--
-----------------------------------------------------------------------
| Alan K. Jackson | To see a World in a Grain of Sand |
| alan at ajackson.org | And a Heaven in a Wild Flower, |
| www.ajackson.org | Hold Infinity in the palm of your hand |
| Houston, Texas | And Eternity in an hour. - Blake |
-----------------------------------------------------------------------
More information about the Linux-users
mailing list