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

Save space by hardlinking instead of copying #546

Open
lvella opened this issue Jun 20, 2021 · 3 comments
Open

Save space by hardlinking instead of copying #546

lvella opened this issue Jun 20, 2021 · 3 comments

Comments

@lvella
Copy link

lvella commented Jun 20, 2021

It would be nice if inside of view_xxxx.mve directory, the file original.jpg was a hardlink of the original, instead of copy (when possible). This would save hard disk space.

@simonfuhrmann
Copy link
Owner

That sounds like a good idea. Instead of hard links, I'd suggest soft links though. Because these work across file system boundaries. The steps to achieve this would be:

  • Implement a link function in the utils library
  • Add an option to makescene --link-originals
  • Add code to makescene that links instead of copying if and only if we're running on Linux

Are you interested in implementing this?

@lvella
Copy link
Author

lvella commented Aug 3, 2021

I for myself think hardlink is better because it won't be affected if the originals are deleted or moved, which works more transparently and can be the default option, benefiting most users without affecting their usage.

If hardlink can't be created, be it because the OS doesn't support or because it crosses filesystem boundaries, it fallbacks to copying.

A switch to enable softlink can be an enhancement independent of this: it works on more situations, but requires user's attention.

What do you think?

@simonfuhrmann
Copy link
Owner

Then we should just have two options perhaps, --softlink-originals and --hardlink-originals, to make it very explicit what is happening. In terms of fallback, I'd rather fail then falling back, again, to make it very explicit what is happening. I'd also suggest to do the same on non-Linux systems: fail if one of the options is used.

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

No branches or pull requests

2 participants