Hi,
I started out with a simple q about howto write a struct to a file but ended up remaking it all. Now Im all .NET IO
Still some questions arise.
I have one file that I want to write the following Struct
from at least two separate objects.
1. How do I convert this struct to something that a BinaryWriter can write?
2. Whos the "best owner" of the file? Each object, the collection holding the objects or the application form/main ?!?
Currently each object own its logfile, thus I can use a separate if I want and many objects can share one if I prefer that. But Im having second thoughts.
3. The struct should be frequently added to the end of the file. Previously I managed that by having a Long at the first position telling where to write the next struct. Is this still the best approach?
but smiling
/Kejpa
I started out with a simple q about howto write a struct to a file but ended up remaking it all. Now Im all .NET IO
Still some questions arise.
I have one file that I want to write the following Struct
Code:
Public Nodeid As Byte 1-127dec
Public SyncTime As Single sec since midnight
Public Value1 As Short +/-30000
Public Value2 As Short +/-30000
Public Value3 As Short +/-30000
1. How do I convert this struct to something that a BinaryWriter can write?
2. Whos the "best owner" of the file? Each object, the collection holding the objects or the application form/main ?!?
Currently each object own its logfile, thus I can use a separate if I want and many objects can share one if I prefer that. But Im having second thoughts.
3. The struct should be frequently added to the end of the file. Previously I managed that by having a Long at the first position telling where to write the next struct. Is this still the best approach?
but smiling
/Kejpa