This is a bug that we apparently have had for a while. Could you report it on github?
Seems to be a regression since #4733 <https://github.com/JuliaLang/julia/pull/4733> Ivar kl. 05:54:28 UTC+2 tirsdag 14. oktober 2014 skrev K leo følgende: > > It does not remove the target file first, but simply writes content on > top of it and keeps the remaining contents. Look at the following > example on Xubuntu 14.04: > > > $ more test1.txt > asdasfd > sfasf > asdad > sdsdg gsdg > $ more test2.txt > dfs > sdfs > sdffsdfsgs sdgsgsdgds gsdgs > sdgs sdgsdsdh > > $ julia > _ > _ _ _(_)_ | A fresh approach to technical computing > (_) | (_) (_) | Documentation: http://docs.julialang.org > _ _ _| |_ __ _ | Type "help()" for help. > | | | | | | |/ _` | | > | | |_| | | | (_| | | Version 0.3.1 (2014-09-21 21:30 UTC) > _/ |\__'_|_|_|\__'_| | Official http://julialang.org release > |__/ | x86_64-linux-gnu > > julia> cp("test1.txt", "test2.txt") > File("test2.txt",false,-1) > > julia> quit() > > $ more test2.txt > asdasfd > sfasf > asdad > sdsdg gsdggsdgs > sdgs sdgsdsdh > >
