Hi :smile: I was wondering why we can only write o...
# prefect-getting-started
e
Hi 😄 I was wondering why we can only write or read bytes on prefect filesystems. Why aren't there any method to write more conventional files like images or videos ?
1
c
Those things are also just bytes, so once you have a filesystem object from a storage block (an fsspec object), you can open an output file pointer and use it to write whatever you want. E.g., if you have an image using PIL, you can pass the file pointer to the save() method of the image object. See here: https://filesystem-spec.readthedocs.io/en/latest/usage.html#use-a-file-system
e
yeah but not all objects are easily convertible to bytes right ? What if my video has a very specific encoding
c
Everything on a computer is represented as bytes one way or another. Just need to figure out the equivalent of the “save” method on whatever library you are using.
👍 1
e
yeah that's true Chris 🙂
thanks for your response 💙