[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 154
  • Last Modified:

Binary read/writing files

I'm really only familar with qbasic's way of binary file access, and I can read binary using the Input command, but if I want to write a byte or two back to that file at a certain byte location without disrupting any other part of that file, how would I go about that?
1 Solution
You could use the standard 'Seek' and 'Put' functions to replace one character in an Binary opened file in the following way :

strInsterString = "@"

Open <file> For Binary As #1

Seek #1, <Position in range between 1 – 2,147,483,647>

Put #1, , strInsterString

Close #1

Hope this helps!    

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now