Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++.moderated > #1991

Re: Multiple files in one

From Daniel Krügler <daniel.kruegler@googlemail.com>
Newsgroups comp.lang.c++.moderated, comp.lang.c++
Subject Re: Multiple files in one
Date 2011-09-12 17:32 -0700
Organization A noiseless patient Spider
Message-ID <j4lqpr$fds$1@dont-email.me> (permalink)
References <a51089c8-6be0-4fa7-9237-39f686aa99a8@z18g2000yqb.googlegroups.com>

Cross-posted to 2 groups.

Show all headers | View raw


Am 12.09.2011 20:44, schrieb fryme:
> I'm trying to create my own file format. I want to store image file
> and some text description in that file.

[..]

> For that purpose i'm using std::ios::binary. Here is some code,
> describes that process (it is sketch, not last variant):
> Writing my file.
>
> long long image_length, desctiption_length;
>
> std::fstream m_out(output_file_path, std::ios::out |
> std::ios::binary);
> std::ifstream input_image(m_image_file_path.toUtf8().data());

[..]

> Reading my file.
>
> std::fstream m_in(m_file_path.toUtf8().data(), std::ios::in );

It seems to me that both input_image and m_in need to be opened as
binary streams as well.

HTH & Greetings from Bremen,

Daniel Krügler


-- 
      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]

Back to comp.lang.c++.moderated | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Multiple files in one fryme <oleg.fry@gmail.com> - 2011-09-12 11:44 -0700
  Re: Multiple files in one Alexander Bartolich <alexander.bartolich@gmx.at> - 2011-09-12 17:31 -0700
  Re: Multiple files in one Paavo Helde <myfirstname@osa.pri.ee> - 2011-09-12 17:32 -0700
  Re: Multiple files in one red floyd <no.spam.here@its.invalid> - 2011-09-12 17:32 -0700
  Re: Multiple files in one Daniel Krügler <daniel.kruegler@googlemail.com> - 2011-09-12 17:32 -0700
  Re: Multiple files in one Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-09-12 17:34 -0700
  Re: Multiple files in one Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2011-09-13 10:51 -0700
  Re: Multiple files in one Daniel James <daniel@me.invalid> - 2011-09-13 10:53 -0700

csiph-web