Changeset 658

Show
Ignore:
Timestamp:
03/23/07 02:36:19 (17 months ago)
Author:
hyriand
Message:

Open incomplete files in append mode. ofstream truncates when out is explicitly set.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/newnet/museekd/museekd/downloadsocket.cpp

    r657 r658  
    139139  // We received data, open the incomplete file if necessary. 
    140140  NNLOG("museek.debug", "Downloading to: %s.", m_Download->incompletePath().c_str()); 
    141   m_Output.open(m_Download->incompletePath().c_str(), std::ofstream::out | std::ofstream::binary | std::ofstream::ate); 
     141  m_Output.open(m_Download->incompletePath().c_str(), std::ofstream::binary | std::ofstream::app | std::ofstream::ate); 
    142142  if(! m_Output.is_open()) 
    143143  { 
     
    150150  // Set the position of the download to EOF 
    151151  m_Download->setPosition(m_Output.tellp()); 
     152  NNLOG("museek.debug", "Set position to %llu (%llu).",m_Download->position(), (off_t)m_Output.tellp()); 
    152153 
    153154  return true;