@@ -39,7 +39,7 @@ void Shell::Setup()
3939 InitializeFolderSystem ();
4040
4141 // Test filesystem functionality - DISABLED to prevent conflicts with USB MSC
42- // TestFileSystem();
42+ TestFileSystem ();
4343}
4444
4545void Shell::Loop () {
@@ -69,21 +69,23 @@ void Shell::TestFileSystem() {
6969 string test_content = " MatrixOS Filesystem Test\n Timestamp: " ;
7070 test_content += std::to_string (Device::Micros ());
7171
72- // Test file write using low-level API
73- MatrixOS:: File::File * file = MatrixOS::File ::Open (test_file, FA_WRITE | FA_CREATE_ALWAYS );
72+ // Test file write using new File API
73+ File* file = MatrixOS::FileSystem ::Open (test_file, " w " );
7474 if (file) {
75- size_t written = MatrixOS::File::Write (file, test_content.c_str (), test_content.length ());
76- MatrixOS::File::Close (file);
75+ size_t written = file->Write (test_content.c_str (), test_content.length ());
76+ file->Close ();
77+ delete file;
7778
7879 if (written == test_content.length ()) {
7980 MLOGD (" Shell" , " File write test: PASS" );
8081
8182 // Test file read
82- file = MatrixOS::File ::Open (test_file, FA_READ );
83+ file = MatrixOS::FileSystem ::Open (test_file, " r " );
8384 if (file) {
8485 char read_buffer[256 ];
85- size_t read_bytes = MatrixOS::File::Read (file, read_buffer, sizeof (read_buffer));
86- MatrixOS::File::Close (file);
86+ size_t read_bytes = file->Read (read_buffer, sizeof (read_buffer));
87+ file->Close ();
88+ delete file;
8789
8890 if (read_bytes == test_content.length ()) {
8991 string read_content (read_buffer, read_bytes);
@@ -100,7 +102,7 @@ void Shell::TestFileSystem() {
100102 }
101103
102104 // Test file deletion
103- if (MatrixOS::File::Delete (test_file)) {
105+ if (MatrixOS::FileSystem::Remove (test_file)) {
104106 MLOGD (" Shell" , " File delete test: PASS" );
105107 } else {
106108 MLOGE (" Shell" , " File delete test: FAIL" );
@@ -114,11 +116,11 @@ void Shell::TestFileSystem() {
114116
115117 // Test directory operations
116118 string test_dir = " /test_dir" ;
117- if (MatrixOS::File::CreateDir (test_dir)) {
119+ if (MatrixOS::FileSystem::MakeDir (test_dir)) {
118120 MLOGD (" Shell" , " Directory create test: PASS" );
119121
120122 // Test directory deletion
121- if (MatrixOS::File::Delete (test_dir)) {
123+ if (MatrixOS::FileSystem::RemoveDir (test_dir)) {
122124 MLOGD (" Shell" , " Directory delete test: PASS" );
123125 } else {
124126 MLOGE (" Shell" , " Directory delete test: FAIL" );
0 commit comments