comparison transform/FileFeatureWriter.cpp @ 514:6acdddf6f99e

* fixes to improve the utility of the CSV feature writer
author Chris Cannam
date Wed, 10 Dec 2008 13:21:10 +0000
parents e7a39c45a7a4
children 1aefb666ecfc
comparison
equal deleted inserted replaced
513:06a6612e7cf1 514:6acdddf6f99e
182 else dirname = QDir::currentPath(); 182 else dirname = QDir::currentPath();
183 183
184 QString filename; 184 QString filename;
185 185
186 if (m_manyFiles && transformId != "") { 186 if (m_manyFiles && transformId != "") {
187 filename = QString("%1-%2.%3").arg(basename).arg(transformId).arg(m_extension); 187 filename = QString("%1_%2.%3").arg(basename).arg(transformId).arg(m_extension);
188 } else { 188 } else {
189 filename = QString("%1.%2").arg(basename).arg(m_extension); 189 filename = QString("%1.%2").arg(basename).arg(m_extension);
190 } 190 }
191
192 filename.replace(':', '_'); // ':' not permitted in Windows
191 193
192 filename = QDir(dirname).filePath(filename); 194 filename = QDir(dirname).filePath(filename);
193 195
194 if (QFileInfo(filename).exists() && !(m_force || m_append)) { 196 if (QFileInfo(filename).exists() && !(m_force || m_append)) {
195 cerr << "FileFeatureWriter: ERROR: Output file \"" << filename.toStdString() << "\" exists (for input file or URL \"" << trackId.toStdString() << "\" and transform \"" << transformId.toStdString() << "\") and neither force nor append is specified -- not overwriting" << endl; 197 cerr << "FileFeatureWriter: ERROR: Output file \"" << filename.toStdString() << "\" exists (for input file or URL \"" << trackId.toStdString() << "\" and transform \"" << transformId.toStdString() << "\") and neither force nor append is specified -- not overwriting" << endl;