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
Advanced Copy Options - Symlinks and more! #833
Conversation
26f0455
to
306f741
Compare
I updated the logic on links UI logic is cleaned up: |
windows btrfs reflink support by calling NOTE: This is slight shenanigans because but the code should be transparently backwards compatible if it get fixed. |
7eccecf
to
a421df2
Compare
I'v now implimented windows Reflink on both winbtrfs and ReFS via DeviceIoControl calls. The old code remains in place for now until we can be confident there are no issues. |
works as expected on ntfs, but i think i came across a bit of an issue: currently, if you try to delete the instance that a copy is symbolically linked to, the copied instance is now completely unusable due to the links being unresolved. imo, a good solution here would be to delete the symlinks and copy over the files from the original instance being deleted - or at least add a warning to the deletion dialog ;) this is awesome though, i love it! edit: forgor to specify symbolic links |
I'm not really sure what to do in this situation. It's nigh impossible to detect when a symlink exists without knowing exactly where to look for it. The only way to warn users when they are deleting an instance another instance links files form would be to keep track of all the symlinks an instance has and do a search through all other instances when doing a delete... I'm not sure that would be smart or quick. |
i can understand speed when recursing through all instances, but keeping track of links not being smart? i would have to disagree with that i think that a great solution here would be to add a key to instance.cfg (if possible) that contains the source of an instance using symbolic links. this would allow the ability to easily recurse through all instances in a performance friendly way, while limiting the more time consuming task of finding symlinks. afterwards, a prompt could be shown explaining something along the lines of "the files of this instance are used by , would you like to delete it as well or copy the files over?" just an idea though, i'm not sure how hard that would be to implement - but again, at bare minimum, i think there needs to be a warning here or else there's a good chance people using this feature are going to come across this and be very confused about what comes up in the error log |
maybe give the original a list in the instance.cfg with all symlinked instances (their IDs), and then when deleting there could be a warning popup with |
eb0bd00
to
a281934
Compare
re-based because clean git history is cool. |
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i may be able to finish it off in the weekend
i lied
sorry, this PR gives me a lot of brain fatigue (your work is great, but os-specific stuff gives me nightmares) 😵
Co-authored-by: flow <flowlnlnln@gmail.com> Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
no worries. don't feel too overwhelmed by it though. when it comes down to it it's pretty simple stuff despite appearances. I documented the parts that need external research to really understand. |
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Is there any possibility we could have an additional option to allow a deletion of the original instance to prompt the user to have the original files migrated to the linked instance? If it's not too difficult, we could even allow linked instances to become "real" instances on command from the user in such case they may want or need it. A good example I can think of is if someone plans on migrating from one version to the next, and has finally decided to remove the previous instance. |
perhaps in another PR. that's a fair bit of work and this one is big enough already. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i swear we will finish this soon 🥺
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
…ce root. Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
6c7ae08
to
d80dee2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good job 🙂 /gen
2 approvals 👀 |
Let's merge, I guess. I probably don't have much to add after @flowln's thorough analysis :D And if the feature has issues, we can hopefully catch them before an eventual release. |
1.20 prerelease 7 gives a warning when opening worlds that use symlinks, and requires allowed symlinks to be added to a text file to silence the warning. Will this cause problems? |
Make an issue for it please |
I haven't actually tested anything so I don't know if its a problem, I just randomly remembered it so figured I would mention it. |
No, this change only affects linking of individual worlds. Linking the saves folder itself will still work the same |
This could still have an effect if the user tries to recursively link during a copy. That will need the file created |
Lets let users copy instances with some more advanced settings, potentially preserving disk-space.
Symbolic links and Hard links are the standard, but I was even able to do CoW on ZFS, BTRFS, XFS, APFS on MacOS, and even BTRFS (via winbrtfs driver) and ReFS on windows!
fix: #761
related: #422, #38
FSCTL_DUPLICATE_EXTENTS_TO_FILE
andDeviceIoControl
)