Hello Tim,
MBS plugins have the solution for what you need to do. The pieces
of code below show in general form how to create a new file and write
some arbitrary data to each of the data and resource forks.
If you need more detail contact me off-list.
dim f,fs1,fs2 as FolderItem
dim s as string
dim o as BinaryStream
dim rf as ResStreamMBS
// open your first file for data fork read data into string (s)
if f=Nil then
f = GetSaveFolderItem("special/any", filename + "." + fileext)
end if
if f <> nil then
o = f.CreateBinaryFile("special/any") // open output
data fork, write some data from string (s)
f.MacCreator=filecreator
f.MacType=filetype
o.Write(s)
o.Close
// open 2nd file for resource fork read data into string (s)
rf=f.createResStreamMBS(filetype,filecreator) // open output
resource fork, write some data from string (s)
rf.Write(s)
rf.Close
end if
Jason
On Jul 27, 2006, at 8:19 PM, [EMAIL PROTECTED] wrote:
Hi Everyone,
I'm trying to reconstitute a Mac file from an email 'AppleDouble'
attachment. The attachment comes in two halves, the data fork file
and a
separate file for the resource fork. I use the data from the first
attached
file to create a new file on my hard drive. I now need to write the
data
from the second attached file to the resource fork of the new file.
Is there anyway within RealBasic (version 2006r3) of doing this?
I realise that I can write specific resources to a resource fork,
but what
I want here is to write the entire resource fork with the binary data
received from the email.
Thanks in advance for any help given.
Tim Barlow
Communications & Information Technology Services
X2317 (62302317)
[EMAIL PROTECTED]
This message may contain confidential information which is intended
only for the individual named.
If you are not the named addressee you should not disseminate,
distribute or copy this email.
Please notify the sender immediately by email if you have received
this email by mistake and delete this email from your system.
Email transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses.
The sender therefore does not accept liability for any errors or
omissions
in the contents of this message which arise as a result of email
transmission.
If verification is required please request a hard copy version.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>