Results 1 to 5 of 5

Thread: Binary Access Write

  1. #1
    Guest

    Cool

    Is there a way to do a binary access write in memory with out opening a file???
    This is my code now:
    Open File For Binary Access Write As #1
    Put #1, , buf
    Close #1

    My variable buf is a buffer from a pdf file and I want to attach it to an Email without creating an intermediate file... Therefore I do not want to open the file --- however I do want to perform the binary access write.

    Any ideas????


  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    I'm not sure what you mean. To write to a file, you have to open it, that's the whole idea about opening files, you read and write from them. If it's writeprotected then you're not supposed to write to it.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3
    Guest
    I want to bypass creating an intermediate file and send my output over Email as a custom attachment. I do not want to open a file and do a binary access write -- right now it is the only way I know how to get the file in it's correct format. I'm searching for a way to do a binary write in memory...

    What I need to attach needs to be translated somehow.
    I get a buffer and then I need to send that however it needs to be translated somehow and the binary access write is the only way I know how to do that at this point.

    Here are small bits the contents of the buf:
    ?????????????????????????????????????????H??????????‰????????‰??????????????????????????4??????? ???4??????????????????????????‹‰???????????A?? ????y <?î????À ´?¯?
    ?»???ã??Û??????????????????????????????????????????????????????????????????Â???a?´d?? ?a ???Aa?a ?^C?A??´ A^????????????~???a A^?????????????? ????????????AAa ?Ð?????´~~a ??????????????a??Aj ??

    And this is after the binary write:
      &h %PDF-1.3
    %äãÏÒ
    5 0 obj
    <</Length 6 0 R
    /Filter/FlateDecode
    >>
    stream
    xœ+ä2Tðâ,. &æendstream
    þä}È
    Og!û6lµR†p†€ú]ˆ{;5„‡Ÿ,•Œ]€ˆúnü“i®˜‚SÙ–Â@<'ü>É,cE²Ë$bXRRZ)ÑìPã Ùdlãl0)

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    :confused:

    I mean how did you translate those "?"'s into that? Binary writes down the memory of variables without descriptors or anything, but i can't anything of what you showed. What methods did you use to get the file? Did you input/get it into a textbox or what?
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5
    Guest
    The buffer (all those ?????'s) came from a pdf component and then I was doing a binary write to get the change in code. I wanted to avoid writing to a file.
    What I am doing now is using the stream object which is new to the ADO 2.5 release.
    By setting the Charset = "Windows-1252" it will then convert the files.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width