Skip to content

Copy a file to itself will remove the file #3155

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

Closed
AntonFagerberg opened this issue Mar 6, 2015 · 1 comment · Fixed by #3344
Closed

Copy a file to itself will remove the file #3155

AntonFagerberg opened this issue Mar 6, 2015 · 1 comment · Fixed by #3344

Comments

@AntonFagerberg
Copy link

If a file is copied to itself, it will remove the file and state that the file does not exist. The expected result should (probably) be that the file is preserved as is.

iex(1)> File.ls!
[]
iex(2)> File.write!("test_file", ":)")
:ok
iex(3)> File.ls!
["test_file"]
iex(4)> File.cp("test_file", "test_file")
{:error, :enoent}
iex(5)> File.ls!
[]
@josevalim
Copy link
Member

Thanks for the report.

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

Successfully merging a pull request may close this issue.

2 participants