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

Files.mv works different according to target parent directory #7646

Closed
rafaelramalho19 opened this issue Sep 3, 2020 · 2 comments
Closed
Labels
kind/bug A bug in existing code (including security flaws) need/author-input Needs input from the original author

Comments

@rafaelramalho19
Copy link
Contributor

rafaelramalho19 commented Sep 3, 2020

Version information:

go-ipfs version: 0.5.1-8431e2e
Repo version: 9
System version: amd64/darwin
Golang version: go1.14.2

Description:

Using ipfs.files.mv in a file to 2+ top-level directory copies the file instead of moving it. When moving files from a path to a direct parent path, the mv command works fine.

Considering we have the following file: /animals/pets/dogs/doge.png

If I do ipfs files mv /animals/pets/dogs/doge.png /animals/pets/dogs, it works as intended (file gets moved and original removed)

if I do ipfs files mv /animals/pets/dogs/doge.png /animals/pets/ or ipfs files mv /animals/pets/dogs/doge.png /animals/ the file gets copied instead.

@rafaelramalho19 rafaelramalho19 added kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization labels Sep 3, 2020
@ipfs ipfs deleted a comment from welcome bot Sep 4, 2020
@lidel lidel added need/author-input Needs input from the original author and removed need/triage Needs initial labeling and prioritization labels Sep 4, 2020
@lidel
Copy link
Member

lidel commented Sep 4, 2020

@rafaelramalho19 I think you made a typo in your repro steps, the thing that "works as intended" moves the files to the same directory it was in the first place(?)

I checked if moving to higher levels is broken, but was unable to reproduce it with a random file, below works as expected:

$ ipfs files mkdir -p /animals/pets/dogs/
$ ipfs files cp /ipfs/bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi /animals/pets/dogs/doge.png
$ ipfs files mv /animals/pets/dogs/doge.png /animals/
$ ipfs files ls /animals/pets/dogs/
$ ipfs files ls /animals/pets/
doge.png
dogs

Can you check again? If the issue is there, it may be specific to a file or directory (in the past I found odd behaviour which was caused by HAMT-sharding), so you may want to share CID of initial animals directory for testing.

@rafaelramalho19
Copy link
Contributor Author

You're right, could be a problem with the folder I was testing at the time, closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) need/author-input Needs input from the original author
Projects
None yet
Development

No branches or pull requests

2 participants