comparison src/Modules/Output/Graphics/Devices/GraphicsOutputDeviceMovie.cc @ 141:bbf4728ffa0e

Windows build fixes.
author tomwalters
date Tue, 02 Nov 2010 23:46:56 +0000
parents 88df1647d1a0
children f03d4455b262
comparison
equal deleted inserted replaced
140:3cd890830891 141:bbf4728ffa0e
181 // Remove files in temporary directory and the dir itself 181 // Remove files in temporary directory and the dir itself
182 //! \todo make portable function, possibly decided on by build system 182 //! \todo make portable function, possibly decided on by build system
183 #ifdef _WINDOWS 183 #ifdef _WINDOWS
184 HANDLE hList; 184 HANDLE hList;
185 WIN32_FIND_DATA FileData; 185 WIN32_FIND_DATA FileData;
186 snprintf(sCmdLine, sizeof(sCmdLine)/sizeof(sCmdLine[0]), "%s/*.*", m_sDir); 186 snprintf(sCmdLine, sizeof(sCmdLine)/sizeof(sCmdLine[0]), "%s/*.*", directory_.c_str());
187 if ((hList = FindFirstFile(sCmdLine, &FileData)) == INVALID_HANDLE_VALUE) { 187 if ((hList = FindFirstFile(sCmdLine, &FileData)) == INVALID_HANDLE_VALUE) {
188 LOG_ERROR(_T("Couldn't remove files from temporary directory.")); 188 LOG_ERROR(_T("Couldn't remove files from temporary directory."));
189 return; 189 return;
190 } 190 }
191 bool bRMfinished = false; 191 bool bRMfinished = false;
192 while (!bRMfinished) { 192 while (!bRMfinished) {
193 snprintf(sCmdLine, 193 snprintf(sCmdLine,
194 sizeof(sCmdLine)/sizeof(sCmdLine[0]), 194 sizeof(sCmdLine)/sizeof(sCmdLine[0]),
195 "%s%s", 195 "%s%s",
196 m_sDir, 196 directory_.c_str(),
197 FileData.cFileName); 197 FileData.cFileName);
198 remove(sCmdLine); 198 remove(sCmdLine);
199 if (!FindNextFile(hList, &FileData) && GetLastError() == ERROR_NO_MORE_FILES) { 199 if (!FindNextFile(hList, &FileData) && GetLastError() == ERROR_NO_MORE_FILES) {
200 bRMfinished = true; 200 bRMfinished = true;
201 } 201 }
202 } 202 }
203 FindClose(hList); 203 FindClose(hList);
204 _rmdir(m_sDir); 204 _rmdir(directory_.c_str());
205 #else 205 #else
206 DIR *dir; 206 DIR *dir;
207 struct dirent *dirent; 207 struct dirent *dirent;
208 if (!(dir = opendir(directory_.c_str()))) { 208 if (!(dir = opendir(directory_.c_str()))) {
209 LOG_ERROR(_T("Couldn't remove files in temporary directory.")); 209 LOG_ERROR(_T("Couldn't remove files in temporary directory."));