

Today I came across a post called AIR Deleted My Desktop posted by John C. Bland II on his blog. John added a new feature to his AIR app to save a file to a network share and was testing it against his desktop directory.
AIR cleaned the directory permanently. The copyTo function when copying a file A in directory D1 to a directory D2 which already has another file with the name A, first deletes D2/A and then copies D1/A to D2. When the from and to paths are the same, instead of returning an error message (or success) without any action, it goes ahead and deletes the D/A first and tries to copy the deleted file to itself which fails, of course.
John himself summed up why this is funny:
Nah, it wasn’t that big of a deal. It was more-so irritating that I wrote the code that did it.
![]()
The post is eight months old, and I hope the AIR team fixed the bug by now. Nevertheless it is interesting. Rather than using exceptions, I think first one could get a read-lock on file A and then proceed.
If you would like to make a comment, please fill out the form below.
lol. Yeah, that was quite funny after the fact.