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

reflink original photos #304

Open
vojta001 opened this issue Aug 4, 2022 · 2 comments
Open

reflink original photos #304

vojta001 opened this issue Aug 4, 2022 · 2 comments
Labels
enhancement New feature or functionality

Comments

@vojta001
Copy link
Contributor

vojta001 commented Aug 4, 2022

Some linux filesystems support lightweight copy-on-write copies of files. Unlike symlinks, they do not break when the original file is moved or deleted. Unlike with hardlinks, changes to the original files do not propagate. Unlike regular copies, they do not take twice the space.

I propose to add an reflink option to --photo-preview, --video-preview, --photo-download and --video-download that acts as copy, but forces reflink creation.

I am willing to help with the implementation, should the maintainers like the idea.

@vojta001 vojta001 added the enhancement New feature or functionality label Aug 4, 2022
@rprieto
Copy link
Member

rprieto commented Jan 5, 2024

Thanks for suggesting this feature. It sounds interesting!

What will be the behaviour if a source file changes? Thumbsup compares the last modified date of the source and target files. Will the target (reflink) appear outdated? Could thumbsup force an update to the reflink?

For the implementation it looks straightforward with fs.copyFile (that we already use for the regular copy) and the COPYFILE_FICLONE or COPYFILE_FICLONE_FORCE flags.

@vojta001
Copy link
Contributor Author

vojta001 commented Jan 5, 2024

The files don't know about each other, it's just a hidden deduplication down there. No data or metadata changes propagate in either direction, so should the last modified date get bumped somehow on the original, it won't match the target.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or functionality
Projects
None yet
Development

No branches or pull requests

2 participants