-
Notifications
You must be signed in to change notification settings - Fork 260
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
saving image to a "new" file, which is a symlink... what should happen? #465
Comments
Just to recap for myself - at the moment, if you ask nibabel to write to a symlink, it will write to the file pointed to by the symlink. Here you're proposing deleting the symlink and replacing it with the written file. This seems like it could get very confusing for people upgrading nibabel to find that their files get written to a different location. Any thoughts from the rest of the team? |
Yeah... As I have noted in the PR I agree that it is quite suboptimal in that regard. Would you mind if i suggest git-annex specific handling? Ie if it is a symlinks and has .git/annex/objects in its resolved path? On July 29, 2016 9:30:22 PM EDT, Matthew Brett [email protected] wrote:
|
Ouch - feels like a hack. Well - because it is a hack. I guess you can't get away with a custom 'save' function that does the deleting for you, because you want all nibabel processing to work transparently with git annex? |
Yeah On July 29, 2016 11:06:29 PM EDT, Matthew Brett [email protected] wrote:
|
So for existing files, you have three options: lone file, hard link, symlink. Is there any context in which one would want (or expect) to truncate a file and not hard links to it? If not, we can at least reduce the scope to symlinks. Even then, I would say that deleting symlinks is not the expected default behavior, so maybe this could add a Or, taking the environment variable route, you could set |
FWIW, updated #466 with annex specific hack and env variable handling. If we add a kwarg there, I would make it |
ATM
>
in shell works):I wondered... would it be sensible to suggest to first remove the file intended to be written to (at least in to_filename) before writing? that would allow to interact with git-annex'ed datasets more easily,
The text was updated successfully, but these errors were encountered: