Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a FileSystemFileHandle copy method #159

Open
johot opened this issue Feb 8, 2024 · 0 comments
Open

Add a FileSystemFileHandle copy method #159

johot opened this issue Feb 8, 2024 · 0 comments
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest

Comments

@johot
Copy link

johot commented Feb 8, 2024

What problem are you trying to solve?

I am currently building a web based image editor/viewer. The user should be able to copy photos / files in the editor.

The problem I am having right now is that there is no copymethod I can find in the file system api. There are functions like remove and move which work in Chrome but no copy method.

I can currently create a copy of a file by basically creating an empty file and copying the content of the original file however this destroys the files last modified metadata. When it comes to photos especially that have no EXIF metadata destroying the last modified date metadata can be very unfortunate.

Is there any plans on supporting a copy method that retains the last modified time? Thank you for your awesome work :D

What solutions exist today?

You can create a new file and copy content from original -> new by using createWritable but this destroys metadata.
For FileSystemHandle there is a move method that doesn't destroy the metadata but in my case I don't want to affect the original file.

How would you solve it?

Add a copy method to FileSystemHandle or at least to FileSystemFileHandle that copies a file just like in the underlying OS preserving the last modified date.

Anything else?

No response

@johot johot added addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest labels Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest
Development

No branches or pull requests

1 participant