@@ -20,7 +20,7 @@ InternalStorage internal = InternalStorage();
2020
2121bool testFileCreationWithOpen (Folder root) {
2222 UFile file = UFile ();
23- String path = root.getPathString () + " /test_open.txt" ;
23+ String path = root.getPathAsString () + " /test_open.txt" ;
2424 Serial.println (path);
2525 if (file.open (path, FileMode::WRITE)) {
2626 Serial.println (" \n --- Test creating file using file.open ---" );
@@ -104,7 +104,7 @@ bool testReadingAll(Folder root) {
104104 file.write (reinterpret_cast <const uint8_t *>(" Hello, World!" ), 13 );
105105 file.close ();
106106
107- if (file.open (root.getPathString () + " /test_read.txt" , FileMode::READ)) {
107+ if (file.open (root.getPathAsString () + " /test_read.txt" , FileMode::READ)) {
108108 char buffer[file.available ()];
109109 size_t bytesRead = file.read (reinterpret_cast <uint8_t *>(buffer), sizeof (buffer));
110110 buffer[bytesRead] = ' \0 ' ; // Null-terminate the string
@@ -136,7 +136,7 @@ bool testSeeking(Folder root) {
136136 file.close ();
137137
138138
139- if (file.open (root.getPathString () + " /test_seek.txt" , FileMode::READ)) {
139+ if (file.open (root.getPathAsString () + " /test_seek.txt" , FileMode::READ)) {
140140 Serial.println (" \n --- Test seeking file ---" );
141141 file.seek (7 );
142142 char buffer[20 ];
@@ -163,7 +163,7 @@ bool testAvailableData(Folder root) {
163163 file.write (reinterpret_cast <const uint8_t *>(" Hello, World!" ), 13 );
164164 file.close ();
165165
166- if (file.open (root.getPathString () + " /test_available.txt" , FileMode::READ)) {
166+ if (file.open (root.getPathAsString () + " /test_available.txt" , FileMode::READ)) {
167167 Serial.println (" \n --- Test available data ---" );
168168 int availableBytes = file.available ();
169169 Serial.println (" Available bytes in file (test_available.txt): " + String (availableBytes));
@@ -193,7 +193,7 @@ bool testCopyingFile(Folder root) {
193193
194194 if (destinationFolder.exists ()) {
195195 Serial.println (" \n --- Test copying a file ---" );
196- Serial.println (" Source file name: " + String (sourceFile.getPathString ()));
196+ Serial.println (" Source file name: " + String (sourceFile.getPathAsString ()));
197197
198198 if (sourceFile.copyTo (destinationFolder)) {
199199 Serial.println (" File copied successfully!" );
@@ -227,8 +227,8 @@ bool testMovingFile(Folder root) {
227227 UFile movedFile = sourceFileMove;
228228 if (movedFile.exists ()) {
229229 Serial.println (" \n --- Test moving a file ---" );
230- Serial.println (" Source file name: " + String (sourceFileMove.getPathString ()));
231- Serial.println (" Destination file name: " + String (destinationFolder.getPathString ()) + " /test_source_move.txt" );
230+ Serial.println (" Source file name: " + String (sourceFileMove.getPathAsString ()));
231+ Serial.println (" Destination file name: " + String (destinationFolder.getPathAsString ()) + " /test_source_move.txt" );
232232 if (sourceFileMove.moveTo (destinationFolder)) {
233233 Serial.println (" File moved successfully!" );
234234 sourceFileMove.close ();
0 commit comments