Results 1 to 2 of 2

Thread: Reading/Writing binary files

  1. #1

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    does anybody know if their is a difference in reading/writing time for binary files if i

    1.) use for each Value the exact position in the file
    Example
    Code:
    Put DatNr,  1, ChangeTime
    Put DatNr, 5, ChangeRandom
    Put DatNr, 9, LfzX
    Put DatNr, 13, LfzY
    or
    2.) just read/write each value after the other, without handing over the exact position?
    Example
    Code:
    Put DatNr, , ChangeTime
    Put DatNr,, ChangeRandom
    Put DatNr,, LfzX
    Put DatNr,, LfzY
    Thanks
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    That depends, you could see the issue like using print method on your form, the currentX will automatically move forward, so you don't need to set currentX every time before you plot text, if you on the other hand specify currentX you know where you have them, but you risk overwriting data if it's not fixed.
    I'd prefer the alternative without specifying position, and use it only when you need to store or read at other positions.
    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.

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