Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: Writing bits to a file


Message #1 by "Kieran Morrison" <kieranmorrison@h...> on Fri, 14 Feb 2003 18:01:50
Kieran,

The MSDN indicates that the FSO does not support creation
or access methods for binary files. Perhaps you'd be best 
served to go the "Open pathname For Binary As filenumber"
route to store binary data.

If you're intent on using the FSO, perhaps convert your
binary to hex values and store it that way thus reducing
16 bytes to 4.

HTH,
Tim

-----Original Message-----
From: Kieran Morrison [mailto:kieranmorrison@h...] 
Sent: Friday, February 14, 2003 6:02 PM
To: professional vb
Subject: [pro_vb] Writing bits to a file

I am trying to write bits to a file...

For example I have the following piece of code:

   Set fso = CreateObject("Scripting.FileSystemObject")
   filepath = Server.MapPath("test.txt")
   Set f = fso.OpenTextFile(filepath, 2, True)
   f.Write "0101010101010101"
   f.Close

This creates a new text document(test.txt) and writes "0101010101010101"

to it. This takes up 16 bytes(128 bits). I want to 
write "0101010101010101" as binary so that it will only take up 16
bits(2 
bytes).

Can the code above be modified to do this?

Thanks for all help in advance.





  Return to Index