|
-
Sep 12th, 2000, 10:40 AM
#1
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????
-
Sep 12th, 2000, 10:44 AM
#2
transcendental analytic
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.
-
Sep 12th, 2000, 11:03 AM
#3
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)
-
Sep 13th, 2000, 05:48 AM
#4
transcendental analytic
: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.
-
Sep 13th, 2000, 09:01 AM
#5
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|