473,385 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Writing AppleDouble file header, How?

Hi

What would be the easiest way, to write an 'AppleDouble file header' to a
file, from vb.net??

AppleDouble file header:
--------------------------------------------------------------------------------
Field Length
--------------------------------------------------------------------------------
Magic number 4 bytes
Version number 4 bytes
Home file system 16 bytes. ASCII encoded
Number of entities 2 bytes
Entry descriptor for each entry
Entry ID 4 bytes
Offset 4 bytes
Length 4 bytes

also it needs to be written in 'Big Endian byte order'

TIA

Søren
Jan 2 '06 #1
3 1224

"Søren M. Olesen" <sm******@hotmail.com> wrote in message
news:Oa**************@TK2MSFTNGP15.phx.gbl...
What would be the easiest way, to write an 'AppleDouble file header' to a
file, from vb.net??


FileOpen ... Binary access

Jan 2 '06 #2
Yeah, but I was kind of wondering if I could create classes/structs holding
the information, and then serialize these to the disk.

Søren

"Homer J Simpson" <no****@nowhere.com> wrote in message
news:Zeeuf.30183$6K2.14360@edtnps90...

"Søren M. Olesen" <sm******@hotmail.com> wrote in message
news:Oa**************@TK2MSFTNGP15.phx.gbl...
What would be the easiest way, to write an 'AppleDouble file header' to a
file, from vb.net??


FileOpen ... Binary access

Jan 3 '06 #3
If I interpret your question correctly, you're asking if you can use .NET's
built-in Serialize and Deserialize methods to somehow directly translate an
AppleHeader (with appropriate strongly-typed properties) class back and
forth to its binary representation. While this is possible, your header
structure is so simple that I would recommend you just write simple encoder
and decoder methods. It's my guess that you'd have to do this anyway to
override the default "endianess" of specific properties. Not to mention
that you'd have to do a binary edit on the destination file one you
"serialized" the class to its Byte array. Have a look at the BinaryReader
and BinaryWriter classes.

- Mitchell S. Honnert

"Søren M. Olesen" <sm******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Yeah, but I was kind of wondering if I could create classes/structs
holding the information, and then serialize these to the disk.

Søren

"Homer J Simpson" <no****@nowhere.com> wrote in message
news:Zeeuf.30183$6K2.14360@edtnps90...

"Søren M. Olesen" <sm******@hotmail.com> wrote in message
news:Oa**************@TK2MSFTNGP15.phx.gbl...
What would be the easiest way, to write an 'AppleDouble file header' to
a file, from vb.net??


FileOpen ... Binary access


Jan 3 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Nhwk | last post by:
I have an unsigned char banner, which contains data for a 12x8 bitmap file. I am attempting to construct and write to disk a .bmp file with this data. So far, I started by constructing the...
6
by: Jeff Thies | last post by:
I've been thinking about writing CSS that's easy to read and adjust at a later date (often by someone else). Here's where I seem to be headed: Breaking the page down into container divs,...
6
by: hpy_awad | last post by:
I am writing stings ((*cust).name),((*cust).address)to a file using fgets but rabish is being wrote to that file ? Look to my source please and help me finding the reason why this rabish is being...
10
by: Jason Curl | last post by:
Dear C group, I'm very interested in writing portable C, but I only have GNU, Sparc and Cygwin to compile on. What I find is the biggest problem to writing portable C is what headers to...
24
by: ypjofficial | last post by:
Hello all, I have written a class with many private data members.and i am putting it in a separate dll file. Now when i link that file while writing my main program module,natuarally i have to...
0
by: bohuge | last post by:
Hey! At the time being I'm working on a backup solution for a Qtek9090 pocketpc, which should be able to find and backup outlook data to a server, local files, messages and contact from the sim...
8
by: SP | last post by:
The following code crashes after I add the two nested FOR loops at the end, I am starting to learn about pointers and would like to understand what I'm doing wrong. I think the problem is the way...
6
by: arne.muller | last post by:
Hello, I've come across some problems reading strucutres from binary files. Basically I've some strutures typedef struct { int i; double x; int n; double *mz;
12
by: vijayarl | last post by:
Hi All, To Moderator : Sorry i have posted this querry to member rather putting in the forum. To All: Problem stmt: I am reading the data from the excel files & writing its content to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.