@@ -256,7 +256,7 @@ class MicroPythonBoard {
256256 return Promise . resolve ( files )
257257 }
258258
259- async fs_cat ( filePath ) {
259+ async fs_cat_binary ( filePath ) {
260260 if ( filePath ) {
261261 await this . enter_raw_repl ( )
262262 let output = await this . exec_raw (
@@ -269,18 +269,18 @@ class MicroPythonBoard {
269269 return Promise . reject ( new Error ( `Path to file was not specified` ) )
270270 }
271271
272- // async fs_cat(filePath) {
273- // if (filePath) {
274- // await this.enter_raw_repl()
275- // let output = await this.exec_raw(
276- // `with open('${filePath}','r') as f:\n while 1:\n b=f.read(256)\n if not b:break\n print(b,end='')`
277- // )
278- // await this.exit_raw_repl()
279- // output = extract(output)
280- // return Promise.resolve(fixLineBreak(output))
281- // }
282- // return Promise.reject(new Error(`Path to file was not specified`))
283- // }
272+ async fs_cat ( filePath ) {
273+ if ( filePath ) {
274+ await this . enter_raw_repl ( )
275+ let output = await this . exec_raw (
276+ `with open('${ filePath } ','r') as f:\n while 1:\n b=f.read(256)\n if not b:break\n print(b,end='')`
277+ )
278+ await this . exit_raw_repl ( )
279+ output = extract ( output )
280+ return Promise . resolve ( fixLineBreak ( output ) )
281+ }
282+ return Promise . reject ( new Error ( `Path to file was not specified` ) )
283+ }
284284
285285 async fs_put ( src , dest , data_consumer ) {
286286 data_consumer = data_consumer || function ( ) { }
0 commit comments