@@ -212,13 +212,12 @@ bool dirExists(const char* path)
212
212
213
213
/* *
214
214
* @brief Unpack file from file system.
215
- * @param srcName Filename .
215
+ * @param spiffsFile SPIFFS dir entry pointer .
216
216
* @param destPath Destination file path path.
217
217
* @return True or false.
218
218
*
219
219
* @author Pascal Gollor (http://www.pgollor.de/cms/)
220
220
*/
221
- // bool unpackFile(const char *srcName, const char *destPath)
222
221
bool unpackFile (spiffs_dirent *spiffsFile, const char *destPath)
223
222
{
224
223
u8_t buffer[spiffsFile->size ];
@@ -237,7 +236,6 @@ bool unpackFile(spiffs_dirent *spiffsFile, const char *destPath)
237
236
FILE* dst = fopen (destPath, " wb" );
238
237
239
238
// Write content into file.
240
- // fputs(buffer, dst);
241
239
fwrite (buffer, sizeof (u8_t ), sizeof (buffer), dst);
242
240
243
241
// Close file.
@@ -295,13 +293,9 @@ bool unpackFiles(std::string sDest)
295
293
// Check if content is a file.
296
294
if ((int )(it->type ) == 1 )
297
295
{
298
- // std::string sDestFile = (const char*)(it->name);
299
- // std::string sDestFilePath = sDest + "/" + sDestFile;
300
- // std::string sDestFilePath = sDest + sDestFile;
301
296
std::string sDestFilePath = sDest + (const char *)(it->name );
302
297
303
298
// Unpack file to destination directory.
304
- // if (! unpackFile(sDestFile.c_str(), sDestFilePath.c_str()) )
305
299
if (! unpackFile (it, sDestFilePath .c_str ()) )
306
300
{
307
301
std::cout << " Can not unpack " << it->name << " !" << std::endl;
0 commit comments