microsoft / pxt-filesystem

File system - beta
https://pxt.microbit.org/pkg/microsoft/pxt-filesystem
MIT License
28 stars 18 forks source link

W10 app: "read to serial" block from filesystem could result in a file in the 'serial viewer #19

Open jaustin opened 6 years ago

jaustin commented 6 years ago

Inside the 'fileystem' module there's a 'read data to serial' block

This blocks doesn't interact very well with the W10 app's serial data viewer.

It would be great if use of this block could trigger a 'file' object inside the serial viewer, that could be dragged back onto the filesystem.

Here's an example program: https://makecode.microbit.org/35902-71245-24007-20291

Even without a drag/dropable file, making a list of 'files' that have been sent over serial that could be 'downloaded' or opened in Excel would be great.

pelikhan commented 6 years ago

The files should be exposed on the MICROBIT drive. It is counterintuitive to have to go through an app to read the files.

jaustin commented 6 years ago

I know that's the best outcome, but we don't have a good way to make that possible, and the testing so far shows that there'd be a huge amount of flakyness in that approach (and inconsistency, because it's very hard to make clear that you can't just write files to this 'drive' too), so the 'read to serial' is what we're left with.

Should we consider renaming parts of the 'filesystem' package and functions to make more sense given they don't show up on the DAPLink drive? Should we call it 'internal filesystem' or something?

The datalogging and serial dumping feature enables a lot of good classroom activities and I think it helps to smooth the process for people if we do something friendly now there's driver-free export over serial.

martinwork commented 5 years ago

Are you sure the file is getting created? The code below displays -1001 (MICROBIT_INVALID_PARAMETER)

let file = files.fsOpen("output.txt") basic.showNumber(file)