@@ -108,68 +108,30 @@ async fn take_screenshot(_options: Option<ScreenshotOptions>) -> Result<String,
108108
109109#[ tauri:: command]
110110async fn read_file ( path : String , _options : Option < FileOperationOptions > ) -> Result < String , String > {
111- let log_msg = format ! ( "🔍 Rust: read_file called with path: '{}'\n " , path) ;
112- let _ = std:: fs:: write ( "/tmp/tauri-debug.log" , log_msg. as_bytes ( ) ) ;
113- println ! ( "🔍 Rust: read_file called with path: '{}'" , path) ;
114-
115- let result = std:: fs:: read_to_string ( & path) . map_err ( |e| {
116- let error_msg = format ! ( "Failed to read file '{}': {}" , path, e) ;
117- let log_msg = format ! ( "🔍 Rust: read_file error: {}\n " , error_msg) ;
118- let _ = std:: fs:: write ( "/tmp/tauri-debug.log" , log_msg. as_bytes ( ) ) ;
119- error_msg
120- } ) ;
121- if result. is_ok ( ) {
122- let log_msg = format ! ( "🔍 Rust: read_file succeeded for path: '{}', content length: {}\n " , path, result. as_ref( ) . unwrap( ) . len( ) ) ;
123- let _ = std:: fs:: write ( "/tmp/tauri-debug.log" , log_msg. as_bytes ( ) ) ;
124- }
125- result
111+ std:: fs:: read_to_string ( & path) . map_err ( |e| format ! ( "Failed to read file '{}': {}" , path, e) )
126112}
127113
128114#[ tauri:: command]
129115async fn write_file ( path : String , contents : String , _options : Option < FileOperationOptions > ) -> Result < ( ) , String > {
130- let log_msg = format ! ( "🔍 Rust: write_file called with path: '{}', contents length: {}, options: {:?}\n " , path, contents. len( ) , _options) ;
131- let _ = std:: fs:: write ( "/tmp/tauri-debug.log" , log_msg. as_bytes ( ) ) ;
132- println ! ( "🔍 Rust: write_file called with path: '{}', contents length: {}, options: {:?}" , path, contents. len( ) , _options) ;
133-
134- std:: fs:: write ( & path, contents) . map_err ( |e| {
135- let error_msg = format ! ( "Failed to write file '{}': {}" , path, e) ;
136- let log_msg = format ! ( "🔍 Rust: write_file error: {}\n " , error_msg) ;
137- let _ = std:: fs:: write ( "/tmp/tauri-debug.log" , log_msg. as_bytes ( ) ) ;
138- error_msg
139- } ) ?;
140-
141- let log_msg = format ! ( "🔍 Rust: write_file succeeded for path: '{}'\n " , path) ;
142- let _ = std:: fs:: write ( "/tmp/tauri-debug.log" , log_msg. as_bytes ( ) ) ;
116+ std:: fs:: write ( & path, contents) . map_err ( |e| format ! ( "Failed to write file '{}': {}" , path, e) ) ?;
143117 Ok ( ( ) )
144118}
145119
146120#[ tauri:: command]
147121async fn delete_file ( path : String ) -> Result < ( ) , String > {
148- let log_msg = format ! ( "🔍 Rust: delete_file called with path: '{}'\n " , path) ;
149- let _ = std:: fs:: write ( "/tmp/tauri-debug.log" , log_msg. as_bytes ( ) ) ;
150- println ! ( "🔍 Rust: delete_file called with path: '{}'" , path) ;
151-
152- std:: fs:: remove_file ( & path) . map_err ( |e| {
153- let error_msg = format ! ( "Failed to delete file '{}': {}" , path, e) ;
154- let log_msg = format ! ( "🔍 Rust: delete_file error: {}\n " , error_msg) ;
155- let _ = std:: fs:: write ( "/tmp/tauri-debug.log" , log_msg. as_bytes ( ) ) ;
156- error_msg
157- } ) ?;
158-
159- let log_msg = format ! ( "🔍 Rust: delete_file succeeded for path: '{}'\n " , path) ;
160- let _ = std:: fs:: write ( "/tmp/tauri-debug.log" , log_msg. as_bytes ( ) ) ;
122+ std:: fs:: remove_file ( & path) . map_err ( |e| format ! ( "Failed to delete file '{}': {}" , path, e) ) ?;
161123 Ok ( ( ) )
162124}
163125
164126#[ tauri:: command]
165127async fn get_current_dir ( ) -> Result < String , String > {
166- println ! ( "🔍 Rust: get_current_dir called" ) ;
167- let _ = std:: fs:: write ( "/tmp/tauri-debug.log" , "🔍 Rust: get_current_dir called\n " ) ;
168128 std:: env:: current_dir ( )
169129 . map ( |path| path. to_string_lossy ( ) . to_string ( ) )
170130 . map_err ( |e| e. to_string ( ) )
171131}
172132
133+ // Test functions removed - skipping parameter tests for now
134+
173135
174136#[ tauri:: command]
175137async fn get_platform_info ( ) -> Result < PlatformInfo , String > {
@@ -217,8 +179,6 @@ async fn write_clipboard(content: String) -> Result<(), String> {
217179}
218180
219181fn main ( ) {
220- let _ = std:: fs:: write ( "/tmp/tauri-debug.log" , "🔍 Rust: Tauri v2 app starting...\n " ) ;
221-
222182 tauri:: Builder :: default ( )
223183 . plugin ( tauri_plugin_fs:: init ( ) )
224184 . invoke_handler ( tauri:: generate_handler![
0 commit comments