enso icon indicating copy to clipboard operation
enso copied to clipboard

Writing a file to the cloud doesn't work

Open AdRiley opened this issue 10 months ago • 2 comments

Image

This is having pressed the Write All button

Image

AdRiley avatar Mar 11 '25 12:03 AdRiley

Image

This is because the parent directory does not exist.

The behaviour is consistent across our filesystems, I think it is rare that write to file creates all parent directories by default - although I do imagine it is quite useful.

radeusgd avatar Mar 12 '25 10:03 radeusgd

I think perhaps the error here is unhelpful - that's why it's confusing.

We can:

  1. make the error better, telling exactly that the 'parent directory does not exist, please create_directory first',
  2. or we can change the semantics of with_output_stream (as that is used for most writing) to default to creating the parent directories.

@AdRiley which one do you prefer? I imagine (2) will be more practical for users.*

  • Although it may sometimes lead to unexpected behaviour - like a typo in directory name is not detected but instead a sibling directory is created.

radeusgd avatar Mar 12 '25 10:03 radeusgd