469,621 Members | 1,803 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,621 developers. It's quick & easy.

Update file

EAI
Hi All,

I have a requirement to update first 200 bytes of a huge file. I know this
can be done in a couple of ways. But all of those require a lot of
processing. What would be the efficient way to do this?

Thank you.
Apr 23 '06 #1
1 1432
EAI wrote:
Hi All,

I have a requirement to update first 200 bytes of a huge file. I know this
can be done in a couple of ways. But all of those require a lot of
processing. What would be the efficient way to do this?


.... just open it and write 200 bytes to it:

byte[] buffer = new byte[200];

using (FileStream fs=new FileStream(@"c:\hugefile.txt",FileMode.Open)) {
fs.Write(buffer, 0, buffer.Length);
}

hth,
Max
Apr 23 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

16 posts views Thread by Philip Boonzaaier | last post: by
reply views Thread by devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.