@@ -387,7 +387,7 @@ void BaseUnpacker::hexDumpData( const char* buff, size_t buffsize, uint32_t outp
387387// show the contents of a given file as a hex dump
388388void BaseUnpacker::hexDumpFile ( fs_FS &fs, const char * filename, uint32_t output_size )
389389{
390- File binFile = fs.open ( filename, FILE_READ );
390+ File binFile = fs.open ( filename, fs_file_read );
391391 // log_w("File size : %d", binFile.size() );
392392 // only dump small files
393393 if ( binFile.size () > 0 ) {
@@ -412,7 +412,7 @@ void BaseUnpacker::hexDumpFile( fs_FS &fs, const char* filename, uint32_t output
412412
413413 void BaseUnpacker::tarGzListDir ( fs_FS &fs, const char * dirName, uint8_t levels, bool hexDump )
414414 {
415- File root = fs.open ( dirName, FILE_READ );
415+ File root = fs.open ( dirName, fs_file_read );
416416 if ( !root ) {
417417 log_e (" [ERROR] in tarGzListDir: Can't open %s dir" , dirName );
418418 if ( halt_on_error () ) targz_system_halt ();
@@ -482,7 +482,7 @@ void BaseUnpacker::hexDumpFile( fs_FS &fs, const char* filename, uint32_t output
482482 // void( hexDump ); // not used (yet?) with ESP82
483483 Serial.printf (" Listing directory %s with level %d\n " , dirname, levels);
484484
485- File root = fs.open (dirname, FILE_READ );
485+ File root = fs.open (dirname, fs_file_read );
486486 if ( !root.isDirectory () ){
487487 log_e ( " %s is not a directory" , dirname );
488488 return ;
@@ -640,7 +640,7 @@ int TarUnpacker::tarHeaderCallBack( TAR::header_translated_t *header, CC_UNUSED
640640 if ( tarFS->exists ( tar_file_path ) ) {
641641 // file will be truncated
642642 /*
643- untarredFile = tarFS->open( file_path, FILE_READ );
643+ untarredFile = tarFS->open( file_path, fs_file_read );
644644 bool isdir = untarredFile.isDirectory();
645645 untarredFile.close();
646646 if( isdir ) {
@@ -665,7 +665,7 @@ int TarUnpacker::tarHeaderCallBack( TAR::header_translated_t *header, CC_UNUSED
665665 log_v (" [TAR] Creating %s" , tar_file_path);
666666 }
667667
668- untarredFile = tarFS->open (tar_file_path, FILE_WRITE );
668+ untarredFile = tarFS->open (tar_file_path, fs_file_wplus );
669669 if (!untarredFile) {
670670 log_e (" [ERROR] in tarHeaderCallBack: Could not open [%s] for write, filesystem full?" , tar_file_path);
671671 setError ( ESP32_TARGZ_FS_ERROR );
@@ -738,7 +738,7 @@ int TarUnpacker::tarEndCallBack( TAR::header_translated_t *header, CC_UNUSED int
738738 return ESP32_TARGZ_FS_WRITE_ERROR;
739739 }
740740 // health check 3: reopen file to check size on filesystem
741- untarredFile = tarFS->open (tar_file_path, FILE_READ );
741+ untarredFile = tarFS->open (tar_file_path, fs_file_read );
742742 size_t tmpsize = untarredFile.size ();
743743 if ( !untarredFile ) {
744744 log_e (" [TAR ERROR] Failed to re-open %s for size reading" , tar_file_path);
@@ -1015,7 +1015,7 @@ bool TarUnpacker::tarExpander( fs_FS &sourceFS, const char* fileName, fs_FS &des
10151015 setError ( ESP32_TARGZ_FS_ERROR );
10161016 return false ;
10171017 }
1018- fs_File tarFile = sourceFS.open ( fileName, FILE_READ );
1018+ fs_File tarFile = sourceFS.open ( fileName, fs_file_read );
10191019 return tarStreamExpander ( (Stream*)&tarFile, tarFile.size (), destFS, destFolder );
10201020}
10211021
@@ -1477,7 +1477,7 @@ bool GzUnpacker::gzExpander( fs_FS sourceFS, const char* sourceFile, fs_FS destF
14771477 if (tgzLogger)
14781478 tgzLogger (" [GZ] Expanding %s to %s\n " , sourceFile, destFile );
14791479
1480- fs_File gz = sourceFS.open ( sourceFile, FILE_READ );
1480+ fs_File gz = sourceFS.open ( sourceFile, fs_file_read );
14811481 if ( !gzProgressCallback ) {
14821482 setGzProgressCallback ( defaultProgressCallback );
14831483 }
@@ -1493,7 +1493,7 @@ bool GzUnpacker::gzExpander( fs_FS sourceFS, const char* sourceFile, fs_FS destF
14931493 log_v (" [GZ INFO] Deleting %s as it is in the way" , destFile);
14941494 destFS.remove ( destFile );
14951495 }
1496- fs_File outfile = destFS.open ( destFile, FILE_WRITE );
1496+ fs_File outfile = destFS.open ( destFile, fs_file_wplus );
14971497 if (!outfile) {
14981498 log_e (" [GZ ERROR] in gzExpander: cannot create destination file, no space left on device ?" );
14991499 gz.close ();
@@ -1523,7 +1523,7 @@ bool GzUnpacker::gzExpander( fs_FS sourceFS, const char* sourceFile, fs_FS destF
15231523 log_v (" uzLib expander finished!" );
15241524
15251525 /*
1526- outfile = destFS.open( destFile, FILE_READ );
1526+ outfile = destFS.open( destFile, fs_file_read );
15271527 log_d("Expanded %s to %s (%d bytes)", sourceFile, destFile, outfile.size() );
15281528 outfile.close();
15291529 */
@@ -1591,7 +1591,7 @@ bool GzUnpacker::gzStreamExpander( Stream* sourceStream, fs_FS destFS, const cha
15911591 log_v (" [GZ INFO] Deleting %s as it is in the way" , destFile);
15921592 destFS.remove ( destFile );
15931593 }
1594- fs_File outFile = destFS.open (destFile, FILE_WRITE );
1594+ fs_File outFile = destFS.open (destFile, fs_file_wplus );
15951595 if (!outFile) {
15961596 log_e (" [GZ ERROR] in gzExpander: cannot create destination file, no space left on device ?" );
15971597 setError ( ESP32_TARGZ_UZLIB_INVALID_FILE );
@@ -1619,7 +1619,7 @@ bool GzUnpacker::gzStreamExpander( Stream* sourceStream, fs_FS destFS, const cha
16191619 log_v (" uzLib expander finished!" );
16201620
16211621 /*
1622- outfile = destFS.open( destFile, FILE_READ );
1622+ outfile = destFS.open( destFile, fs_file_read );
16231623 log_d("Expanded %s to %s (%d bytes)", sourceFile, destFile, outfile.size() );
16241624 outfile.close();
16251625 */
@@ -1723,7 +1723,7 @@ bool GzUnpacker::gzStreamExpander( Stream *stream, size_t gz_size )
17231723 return false ;
17241724 }
17251725 log_v (" uzLib SPIFFS Updater start!" );
1726- fs_File gz = fs.open ( gz_filename, FILE_READ );
1726+ fs_File gz = fs.open ( gz_filename, fs_file_read );
17271727 #if defined ESP8266
17281728 int update_size = gz.size ();
17291729 #endif
@@ -2069,7 +2069,7 @@ bool TarGzUnpacker::tarGzExpanderNoTempFile( fs_FS sourceFS, const char* sourceF
20692069 setError ( ESP32_TARGZ_UZLIB_INVALID_FILE );
20702070 return false ;
20712071 }
2072- fs_File gz = sourceFS.open ( sourceFile, FILE_READ );
2072+ fs_File gz = sourceFS.open ( sourceFile, fs_file_read );
20732073
20742074 if (tgzLogger)
20752075 tgzLogger (" [TGZ] Will direct-expand %s to %s\n " , sourceFile, destFolder );
0 commit comments