-
Notifications
You must be signed in to change notification settings - Fork 274
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
mv('filepath','filepath') results in deletion of the file rather than no action/inplace move #711
mv('filepath','filepath') results in deletion of the file rather than no action/inplace move #711
Comments
hah, that's funny and I suppose not surprising (mv -> cp then rm). You could propose a PR that converts to a no-op if the two paths are identical, or it could be an exception. |
haha yeah that's what I figured was happening. Regarding "propose a PR", I've never contributed to an open-source project before. To clarify, you're suggesting I actually make the code change/PR, correct? Or is there another mechanism to ask for a feature/PR without me making it. Just wondering :) |
You can ask, but developer time is always limited for open source projects. We could say "don't use the same path twice" and be done :) But yes, we encourage people to get involved and contribute code changes when they identify a clear problem. https://anaconda.cloud/your-first-oss-contribution |
@martindurant I can work on it. |
@DavidKatz-il Sweet! I like the idea of it being no-op if path1==path2. |
or perhaps just not deleting it if path1==path2. that way if someone wants to use this to "touch" files they can. |
@martindurant |
Indeed it probably makes sense to add it upstream in fsspec. |
Calling
mv()
ofs3fs.S3FileSystem
with path1==path2 results in deletion. This is not the expected behavior, as a POSIXmv
results in a message saying they are the same file, and in particular does not result in deletion.Working example:
Now, the file in my bucket at location
path_to_file
is deleted.I have versioning enabled on my bucket for what its worth, so I see the delete marker.
The text was updated successfully, but these errors were encountered: