Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hey guys

Is there any way to add some bytes to a specific place in a file WITHOUT reading all the file in the memory ?

Assume that the file is very large up to 200Mb

i tried to use the append mode in conjuction with seek, but i get an exception that you can't seek in append mode

so i assume that's not the way to do it

       Dim Fstr As New FileStream("test.txt", FileMode.Append)
       Dim data(10) As Byte
       Fstr.Seek(50, SeekOrigin.Begin)
       Fstr.Write(Data, 0, 10)

Any ideas ?

Posted

Divil, thanks for your reply

i know that, and i know in depth about that stuff, but there should be a way to do it.

I mean how all the other applications can.

Let's take the simplest winamp, when you changing a id3v2 tag it increases the size of the file instantly to write the information on the start of the file ?

I know winamp is actually built on C++ (And i actually know how to do it in c) but there should be some class in the whole .net framework that does that.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...