Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Binary file: Platform-Independent

Binary file: Platform-Independent

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    I need to read and write data in binary format, but working on any platform. For example, a file created on Windows should be read on Unix. I can’t find any info on that. Anyone can give me hints? TIA.

    L U 2 Replies Last reply
    0
    • L Lost User

      I need to read and write data in binary format, but working on any platform. For example, a file created on Windows should be read on Unix. I can’t find any info on that. Anyone can give me hints? TIA.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Hmmm, I can't see why this would be any great problem. Most importantly you need to make sure that every platform uses the same format for the binary files (but that's a given). Platform to platform you're going find differences in the number of bits used to represent a value, how arrays are stored, and the whole big-endian, little-endian thing as well. I think if you stick to using 8 bit bytes and use your own routines for building the binary files, you should be ok?

      1 Reply Last reply
      0
      • L Lost User

        I need to read and write data in binary format, but working on any platform. For example, a file created on Windows should be read on Unix. I can’t find any info on that. Anyone can give me hints? TIA.

        U Offline
        U Offline
        User 1681
        wrote on last edited by
        #3

        Goto http://chesworth.com/pv/downloads/libs.htm and download bllib11.zip This will give you a start.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups