CrossCopy / tauri-plugin-clipboard

A Tauri clipboard plugin with text, files, html, RTF, and image support. Clipboard content update monitoring is also supported.
https://crosscopy.github.io/tauri-plugin-clipboard/
MIT License
122 stars 6 forks source link

Why is there a `readFiles` method but not a `writeFiles` method? #37

Closed ayangweb closed 3 weeks ago

ayangweb commented 3 weeks ago

HeyπŸ‘‹, Why is there a readFiles method but not a writeFiles method? Did you forget to add it, or are there other considerations?😁

HuakunShen commented 3 weeks ago

https://crosscopy.github.io/tauri-plugin-clipboard/functions/writeFilesURIs.html

There is.

ayangweb commented 3 weeks ago

https://crosscopy.github.io/tauri-plugin-clipboard/functions/writeFilesURIs.html

There is.

Yes, I know there are readFilesURIs and writeFilesURIs, but the path to readFilesURIs can only be read by removing the file:// prefix on MacOS when using tauri-plugin-fs-extra's metadata on MacOS, you can only read the information by removing the file:// prefix! readFiles is perfectly compatible with both MacOS and Windows, but there is no writeFiles method!

image image
HuakunShen commented 2 weeks ago

The reason is they are too similar. uri is simply file path with file:// prefix on unix based system and no difference on windows. I added writeFiles in the latest release.

ayangweb commented 2 weeks ago

The reason is they are too similar. uri is simply file path with file:// prefix on unix based system and no difference on windows. I added writeFiles in the latest release.

Ok, thanks, I don't know linux, but in macOS and Windows, as far as I've come across so far, removing file:// is perfectly adequate! 😁