title: Saving other files in a own data store with fstream
body: <p>I am developing at the time a small Filestoresystem, which should store
  some files like <code>.png</code>´s and so in it.
  ,
  So I read the bytes from the <code>.png</code> in a <code>char</code> vector successfully, the size of the vector is the same size as the picture (it should be OK).
  Then, I wanted to save the bytes in another <code>.png</code>.</p>
  
  <p>Actually, I created the File succesfully, but the File is completely empty.</p>
  
  <p>Here is the most important code, I guess:</p>
  
  <pre><code>void storedFile::saveData(char Path[]){
  
  std::fstream file;
  file.open(Path,std::ios::trunc|std::ios::out|std::ios::binary);
  if(!file.is_open())
      std::cout &lt;&lt; "Couldn´t open saved File (In Func saveData())" &lt;&lt; std::endl;
  file.write((char*)&amp;Data,sizeof(char) * Data.size());
  file.close();}
  </code></pre>
  
  <p>I think that I did it right, but it's not working.</p>
  
  <p>Again, the bytes of the <code>.png</code> are stored in <code>Data</code>.
  I tested after every opening and reading, if it opened and so on, everything worked fine (no error codes appeared).</p>