By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,994 Members | 1,166 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,994 IT Pros & Developers. It's quick & easy.

how to add a string to the beginning of a large binary file?

P: n/a
I want to add a string such as "I love you" to the beginning of a binary file,
How to? and how to delete the string if I want to get the original file?

thanks.
Jul 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
could ildg wrote:
I want to add a string such as "I love you" to the beginning of a binary file,
How to? and how to delete the string if I want to get the original file?


You shouldn't use Python to write a virus :-)

-pu
Jul 18 '05 #2

P: n/a
I'm not going to,
I just want to know how to manipulate a large file and insert or
delete some stuff in it.

On Mon, 28 Mar 2005 09:43:41 +0200, Patrick Useldinger
<pu*********@gmail.com> wrote:
could ildg wrote:
I want to add a string such as "I love you" to the beginning of a binary file,
How to? and how to delete the string if I want to get the original file?


You shouldn't use Python to write a virus :-)

-pu
--
http://mail.python.org/mailman/listinfo/python-list

Jul 18 '05 #3

P: n/a
"could ildg" <co*******@gmail.com> wrote:
I just want to know how to manipulate a large file and insert or
delete some stuff in it.


you cannot insert or delete stuff in files in contemporary operating systems;
all you can do is to overwrite parts of the file, or add/remove stuff at the end
of the file.

to change a file in any other way, you have to create a new file (either by
loading the old file into memory, or by copying the contents of the old file
to a new temporary file, and removing/renaming the files when you're done)

</F>

Jul 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.