FileKit icon indicating copy to clipboard operation
FileKit copied to clipboard

Add ability to create temp file with this library.

Open Monabr opened this issue 1 year ago • 3 comments

Hello.

Now if I want to create a file for my application I need to use an additional library. I would like to be able to do this in one place as well as other file handling - in this library.

Please add such a feature.

Monabr avatar Sep 28 '24 21:09 Monabr

What do you mean by temp file? Do you mean an empty file? Or do you mean saving a file without opening the file picker?

ghost avatar Sep 28 '24 21:09 ghost

@santiwanti I mean to create file in cache directory and fill it with data.

do you mean saving a file without opening the file picker

Yes, I do.

Monabr avatar Sep 28 '24 22:09 Monabr

That is something that @vinceglb is working on with an API change. I will link this comment to that PR, but it's a pretty big PR so it might take a while to merge

ghost avatar Sep 28 '24 22:09 ghost

With FileKit 0.10.0-beta01, it's now easy to create app temp files:

val file = PlatformFile(FileKit.cacheDir, "temporary.txt")
file.writeText("Hello World")

Read more here:

  • https://filekit.mintlify.app/core/platform-file
  • https://filekit.mintlify.app/core/write-file
  • https://filekit.mintlify.app/core/file-utils

vinceglb avatar Mar 04 '25 14:03 vinceglb