FileInfo x = new FileInfo("a");
x.Copy("b"); // <-- returns a new FileInfo with the path "b", and also mutate x so its path is now "b"
x.Delete(); // Boom you lost your copy ("b"), but "a" is still there!
It seems intended but while I can see how this is the right behaviour for Move(), I can't follow the reasoning for Copy(). Besides, System.IO.*Info.Copy() don't mutate their instances (There is a discrepancy there between System.IO and AlphaFS).
It seems intended but while I can see how this is the right behaviour for
Move()
, I can't follow the reasoning forCopy()
. Besides, System.IO.*Info.Copy() don't mutate their instances (There is a discrepancy there between System.IO and AlphaFS).